List ADT Simulator

The List ADT defines an ordered sequence with indexed access, insertion, deletion, search, and traversal. This simulator compares two common Java-style implementations: contiguous ArrayList storage and node-based LinkedList storage.

Operations

350 ms

ArrayList-style storage

LinkedList-style storage

Example list loaded.

Current phase: Ready
Size0
ArrayList steps0
LinkedList steps0
Last result
OperationArrayListLinkedList
Access by indexO(1)O(n)
AppendAmortized O(1)O(1) with tail reference
PrependO(n)O(1)
Insert/Delete in middleO(n) due to shiftingO(n) to reach position
SearchO(n)O(n)

Concepts

ADT versus implementation

The List ADT describes what operations are available. ArrayList and LinkedList describe how those operations are implemented.

ArrayList trade-off

Contiguous storage gives fast indexed access, but insertion or deletion may require shifting many elements.

LinkedList trade-off

Nodes can be relinked efficiently once a position is reached, but indexed access requires traversal.

Same logical list

Both visualizations hold the same sequence. The simulator emphasizes that identical ADT behavior can have different implementation costs.