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
Can we store primitives in collections?
Explain what is a spanning tree?
What is 2 dimensional linked list?
What are different types of sorting techniques?
Why hashtable is faster than arraylist?
What is sort function?
Describe the complexity of Quick Sort
What is comparator interface used for?
Why you need a data structure?
What is the best case for bubble sort?
Can hashmap be sorted?
What is difference between list and linked list?
How does arraylist store data?
What is the use of isEmpty() member methods?
Why do we use insertion sort?