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
ArrayList-style storage
LinkedList-style storage
Example list loaded.
Current phase: Ready
Size0
ArrayList steps0
LinkedList steps0
Last result—
| Operation | ArrayList | LinkedList |
|---|---|---|
| Access by index | O(1) | O(n) |
| Append | Amortized O(1) | O(1) with tail reference |
| Prepend | O(n) | O(1) |
| Insert/Delete in middle | O(n) due to shifting | O(n) to reach position |
| Search | O(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.