[Solved] ArrayList vs LinkedList Java [duplicate]


ArrayList is a list implementation that’s backed by an Object[]. It supports random access and dynamic resizing.

LinkedList is a list implementation that uses references to head and tail to navigate it. It has no random access capabilities, but it too supports dynamic resizing.

Bear in mind that both support the get(int index) signature, but the difference between the two implementations is performance: with an ArrayList, that’s a matter of going to the index position, whereas with a LinkedList, you have to walk down the object chain (either from the front or the rear, depending on what you’ve indexed into).

solved ArrayList vs LinkedList Java [duplicate]