DEV Community

jojongumi
jojongumi

Posted on

Data Structures 101: Introduction to Data Structures and Algorithms.

Definitions:

A Data Structure refers to a way of organizing so as to use it effectively.
The 'use' of this data is during processes such as when storing, retrieving or modifying it in a computer's memory.
The ideal requirement from a programmer during the design of any of these processes would be to use minimum space in memory while still maintaining minimum running time.
Therefore, the need for Data Structure can be summarized as follows:

  • To allow for efficient management of huge amount of data
  • To allow for fast sorting and searching data

Types of Data Structure:

  1. Primitive Data Structure
  2. Adaptive Data Structure

The figure below shows the different classifications of data structures:

Image description

1. Primitive Data Structure

These refer to data structures such as integer, char, float and Boolean etc. that come built-in to programs.

2. Non-Primitive (Adaptive) Data Structure

These refer to more complex data structures that are built upon from primitive data structures.
Their formation is as a set of data elements that are either of the same data type (homogenous) or of different data type (heterogeneous).

These are further divided into:

  • Linear Data Structure: These emphasize on data that has been arranged in one dimension (i.e. sequentially) such as arrays, linked lists, stacks, queues.
  • Non-Linear Data Structure: These emphasize on data that has been arranged in multiple dimensions (i.e. hierarchically) such as trees, graphs, tables.

Algorithms

An Algorithm refers to a set of instructions which are executed in order so as to perform a certain task.
Some of the various algorithms that are mainly performed on Data Structures include:-
- Traversing: this refers to accessing a data element for processing
- Searching: this refers to finding the location of one or more data items
- Inserting: this refers to adding a new data element to a pre-existing collection of data elements
- Deleting: this refers to removing a data element from a pre-existing collection of data elements
- Sorting: this refers to arranging data elements in a certain order
- Merging: this refers to combining two separate collection of data elements that have been sorted into one list of sorted data elements

Top comments (0)