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 are all the classes and interfaces that are available in the collections?
How can we remove loops in a linked list? What are the functions of fast and slow pointers?
What happens if we put a key object in a hashmap which exists?
Which is better merge or quick sort?
List out the basic operations that can be performed on a stack?
How does a hashmap work?
In tree construction which is the suitable efficient data structure?
List some applications of multilinked structures?
What is worst case complexity algorithm?
Where the data structures are used?
List the area of applications of data structure.
What is bubble sort used for?
Why use a tuple instead of a list?
Define the tree data structure.
How do you use the sort function?