Tuesday, July 30, 2013

What is a non-linear datastructure?

A non-linear datastrucutre is a datastructure in which the data items in the memory are not allocated contiguously i.e. the data items are dispersed in the memory. The first data item will have a link to the second data item and second data item will have a link to the third data item and so on.

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 datastructure are Linked List

0 comments:

Post a Comment