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 insert a new node in linked list where free node will be available?
What is link list in data structure?
Sorting is not possible by using which of the methods?
What is data structure explain in detail?
What are different methods of collision resolution in hashing.
Can we add duplicate keys in a hashmap?
What do you mean by selection sort?
What are the topics in data structures?
Can you override methods of arraylist?
Which is better arraylist or linkedlist?
Explain the term run-time stack?
What is homogeneous array?
How do you clear a stack?
What is the family trees and connection by clause?
What is the need of sorting?