Loading section...

O(1) -- Constant Time

An O(1) operation takes the same amount of time whether your dataset has ten rows or ten billion. The "1" does not mean it takes one nanosecond or performs one step. It means the time is constant with respect to the input size. Think of it like looking up a word in a dictionary by page number: it does not matter if the dictionary has 200 pages or 200,000 pages, flipping to page 47 always takes the same effort. That is O(1). Why it matters: unlike a scan, a hash lookup computes exactly where your data lives. No matter how many rows the table has, it always takes one step. Dictionary and Set Lookups: Your Best Friend Python dictionaries and sets use hash tables internally. When you write user_scores["alice"], Python computes a hash of the key "alice," uses that hash to calculate a memory add