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
What is variable size arrays?and why we use it?
Why using cookie to store session info is a better idea than just using session info in the request?
What is Storage Structures and File Structures? Can you show their relation? What are the examples of each? Thanks
What are the issues that hamper the efficiency in sorting a file?
What is the best complexity of bubble sort?
Is a hashmap a dictionary?
What is selection in an algorithm?
What is mean by sorting?
What is an algorithm in coding?
How does a hashmap work?
What is the difference between Array and Arraylist?
Explain what are the major data structures used in the hierarchical data model?
Why do we use dynamic arrays?
What is link list in data structure?
Differentiate file structure from storage structure?