why it is difficult to store linked list as an array?
Answer Posted / codex
Its not difficult if you need to copy items in linked list to an array you should traverse the list starting first element and copy each value you pass by to an array.
if you are asking why do we use a linked list rather than array then it's because an array needs to have a fixed size but in a linked list you can add as much items as you can.but If you really need to use an array you can use an arraylist with resize feature.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Define disjoint set adt?
How does a selection sort work for an array?
Why we need cursor implementation of linked lists?
What is stable sort example?
Explain in brief a linked list.
What is a queue in data structure?
Which collection class is thread safe?
What are the different data structures?
State the advantages of using postfix notations?
Differentiate between iterator and listiterator.
How to get the index of an array element?
What is array in data structure with example?
What is raid (redundant array of inexpensive disks)? Explain its level?
What are the disadvantages of linear list?
What are the different types of hash functions?