Non Linear Data Structures

What is a non-linear datastructure?

A non-linear data structure is a data structure in which a data item is connected to several other data items. So that a given data item has the possibility to reach one-or-more data items.

Pros
  • Uses memory efficiently that the free contiguous memory in not an requirement for allocating data items
  • The length of the data items is not necessary to be known prior to allocation
Cons
  • Overhead of the link to the next data item
Examples of non-linear data-structures are Graphs and Trees. However Linked List and Arrays are linear data structures.