Time Complexity O(1), O(log n) - What "Fast" Means
This notation shows whether the time taken stays the same no matter how much the data grows.
| Notation | Meaning | Analogy |
|---|---|---|
| O(1) | Instant, regardless of how much data there is | Looking at your ticket number and opening that locker right away |
| O(n) | Gets slower in proportion to the amount of data | Opening boxes one by one from box 1 to the end |
| O(log n) | Even if the data grows 100x, only a few steps are added | Searching by cutting the range in half each time |
Why the requirements say "insert/delete/move must be O(1)": LRU tracking happens on every command, so it has to be instant.
Summary
| Concept | Plain-language summary |
|---|---|
| O(1) | Handled instantly even as data grows |
Source: Codyssey-B1/B5-1
