Tapad Interview Question

what's the difference between linked list and arraylist

Interview Answer

Anonymous

Apr 19, 2018

Arraylists uses dynamic arrays under the hood which makes them slow for data manipulation (although fast for storage and retrieval). For instance, deleting an element in ArrayList will cause a bit-wise shift in memory. On the other hand, LinkedList is implemented as nodes with one node leading to the next or previous (in the case of a doubly-linked list). This makes them faster in data manipulation. For example, data deletion requires reconnecting the next and previous pointers to eliminate the deleted node.