Home / Questions / How do you decide when to use ArrayList and LinkedList?
Explanatory Question

How do you decide when to use ArrayList and LinkedList?

👁 776 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

If you need to frequently add and remove elements from the middle of the list and only access the list elements sequentially, then LinkedList should be used. If you need to support random access, without inserting or removing elements from any place other than the end, then ArrayList should be used.