Glossary

cache locality

the CPU's cache prefetches nearby memory automatically. Linked list nodes can be scattered across the heap, leading to **cache misses** on each pointer dereference. In practice, this means array traversal is often significantly faster than linked list traversal, even when both are O(n).

Learn More

Related Terms