Difference Between ArrayList And LinkedList
ArrayList | LinkedList |
---|---|
Underlying Data structure is dynamic/growable array to store elements. | Underlying Data structure is doubly linked list to store elements. |
It is best/fast when frequent operations are retrieval. | It is best/fast when frequent operations are manipulations like deletion,updatation because it uses doubly linked list so no shifting required in memory. |
It is worst/slow when frequent operations are manipulations like deletion,updation etc in between because several shift operation will be happened. | It is worst/slow when frequent operations are retrieval because elements won't stored in consecutive memory location. |
It can be act as list only because it implements List Interface only. | It can be act as list and queue because it implements List and Deque Interface. |