Introduction
Nowadays, in the technology influenced world, Data and its information is a more essential part, and various implementations are made to store in different ways. A data structure is a particular way of organizing data in a computer so that it can be used effectively.
For example, we can store items with same data type can be stored in array data structure.
Index |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
. |
. |
. |
. |
Value |
S |
P |
A |
R |
K |
D |
A |
T |
A |
B |
O |
X |
. |
. |
. |
. |
Memory location |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
. |
. |
. |
. |
In the above example, the characters are stored in the array with the contiguous memory location.
Data can be stored in many different ways such as logical or mathematical for a particular organization of data is termed as data structure. The specific data model depends on two factors:
Categories of Data Structure
Linear Data
Structure
A data structure is said to be linear if the data are combined to form any specific order. There are two techniques of representing such linear structure within memory.
Common examples of linear data structure are:
Non-linear
Data Structure
In the non-linear data structure, all the elements are linked with hierarchal relationship.
Examples of Non-linear Data Structure are:
Graph
In Graph, data sometimes hold a relationship between the pairs of elements which is not necessarily following the hierarchical structure.
Tree
In Tree, data hold a hierarchical relationship between various elements. The data structure that reflects this relationship is termed as rooted tree graph or a tree.