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
List the applications of stacks?
Define biconnectivity?
Does treemap allow null values?
What are the difference between malloc() and calloc()?
What are sorting algorithms used for?
Is pointer a variable?
Is set sorted?
What is heap tree?
Define an algorithm. What are the types of algorithms?
What is a undirected graph?
What is time complexity of hashmap?
Explain pre-order and in-order tree traversal.
What is the difference between Array and LinkedList?
What does the term sorting refer to?
Is it possible to store null key and null values in a hashmap?