12. Summary: What I Finally Understood About Linked Lists
- Structure: Nodes bundling data + pointer. No contiguous memory required.
- Advantages: Mid-list insertion/deletion in O(1). Works in fragmented memory.
- Disadvantages: O(N) lookup. Poor cache efficiency. Pointer overhead.
- Variations: Circular (Round Robin), Doubly (LRU Cache), Sentinel (edge case elimination).
- Reality: Not directly used in high-level languages, but crucial as underlying principle.
- Core insight: Completely different philosophy from arrays. Tradeoff between lookup vs insertion/deletion.
I understood Linked Lists as a "scavenger hunt." To find the next location, you must open the current note. Seems inefficient, but adding or removing notes is instant. Once I accepted this difference, it became clear when to use arrays vs linked lists.
Ultimately, data structures have no single right answer. Only situation-appropriate choices. Linked Lists are one of those choices.