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

Array vs Linklist

List out the differences between an array and a linklist data structure.
Asked by: Aqan12 | Member Since Apr-2010 | Asked on: May 25th, 2010

View all questions by Aqan12   View all answers by Aqan12

Showing Answers 1 - 2 of 2 Answers
rumesh.cse

Answered On : Jun 10th, 2010

View all answers by rumesh.cse

In liknked list insertion and deletion can be done anywhere in the structure, since the previous and next elements in the structures are linked to each other.

Whereas in arrays, there is no link between the elements in the structure, therefore insertion and deletion cannot be performed anywhere in the structure. It can only be performed at the end of the structure.


  
Login to rate this answer.
KS111

Answered On : Jun 21st, 2010

View all answers by KS111

1. The allocation of array elements in memory is contiguous. Each element in a Linked list can be placed anywhere in the memory.

2. Once defined, array size cannot be modified. In a linked list size can be modified dynamically.

3. Array is random access structure. Meaning, we can directly access the nth element by its index value. Linked list is sequential access data structure. In order to access nth element, we need to traverse all the nodes from starting till nth element.

- KS
(Please correct me if I made any mistakes. I would be more than happy to receive feedback)

Yes  2 Users have rated as useful.
  
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.