How do you decide when to use ArrayList and When to use LinkedList?5
971 5b5cc7cee4d2b41977751118
Q: How do you decide when to use ArrayList and When to use LinkedList?
- Show Answer
- Workspace
- Discuss
Answer :
Explanation :
If you need to support random access, without inserting or removing elements from any place other than the end, then ArrayList offers the optimal collection. If, however, you need to frequently add and remove elements from the middle of the list and only access the list elements sequentially, then LinkedList offers the better implementation.
Similar Questions
Since Nithya and Suganya exchange places, so Rita’s new position is the same as Monika’s earlier position. This position is 17th from the right and 10th from the left. Therefore Number of girls in the row = (16 + 1 + 9) = 26.