← capítulo

Linked lists: singly and doubly

Elements scattered, connected by pointers. The opposite bet from the array.

The trade

Access is a walk

No jumping ahead — follow next, one hop at a time. Nine hops to reach a value near the end.

Different structures win different ops

Front: linked/deque win. By index: array wins (~1300× at n=4000).

Use the right one

Takeaway

Array wins the index and the cache. Linked list wins the ends and held positions. Next: clamp the operations to the cheap ends → stacks and queues.