GeekInterview.com
Series: Subject: Topic:
Question: 12 of 246

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

Asked by: Interview Candidate | Asked on: Nov 6th, 2011
Showing Answers 1 - 1 of 1 Answers
snyder

Answered On : Feb 27th, 2012

View all answers by snyder

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.

  
Login to rate this answer.

Give your answer:

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

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.