Differentiate between linear and non linear data structures.
Linear data structure |
NonLinear data structure |
A data structure is said to be Linear, if its elements are connected in linear fashion by means of logically or in sequence memory locations. |
Nonlinear data structures are those data structure in which data items are not arranged in a sequence. |
Nonlinear data structures are those data structure in which data items are not arranged in a sequence. |
Every item is attached with many other items. |
Data items can be traversed in a single run. |
Data can not be traversed in a single run. |
Examples of Linear Data Structure are Stack and Queue. |
Examples of Non-linear Data Structure are Tree and Graph. |
It is easy to implement. |
It is difficult to implement. |