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
How to get largest and smallest number in an array?
How does insertion sort works?
What are the 3 types of variables?
Define a right-skewed binary tree?
What is list and its types?
What is the need for priority queue?
Define rehashing?
What are skew trees? For a tree with 4 nodes draw all possible binary? Generalize for n nodes how many binary trees can be drawn?
Which process places data at the back of the queue?
What is a static structure?
Explain what is a spanning tree?
Is hashtable throw concurrentmodificationexception?
Can a stack be described as a pointer? Explain.
State the different types of linked lists?
What is an acyclic graph?