What are the advantages and disadvantages of non linear data structure ?

Showing Answers 1 - 3 of 3 Answers

snyder

  • Feb 27th, 2012
 

Advantage

The basic and the only (in my opinion) advantage is that various algorithms such as searching algorithms are optimized using non linear data structure.
When time complexity is compared, the non linear data structure is the winner in some algorithms eg. Dijkstras.

Disadvantages

1. They are difficult to create, maintain and manipulate as many of them are implemented using pointers.

2. They do not provide sequential access, this maybe advantageous in some algorithms but in others it is a disaster.

3. non linear data structure takes up more memory as compared to linear data structure. This is mainly because non-linear ds requires pointers or adjacency matrix or some other technique to logically represent it.

For eg. a circular queue is physically represented as an array which is that various memory locations scattered over the memory are assigned to it but logically pointers are required to facilitate the properties provided by circular queue. In simple words one node points to another via a pointer.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions