Oris
Today
Universe
Explore
Studio
Authors
Account
Lesson 1 of 7
Why is reading arr[i] an O(1) operation?
The address is computed directly as base + i * elementSize, with no scanning.
The CPU searches from the front until it reaches index i.
Arrays keep a hash table mapping indices to values.
The array sorts itself so index i is always first.
Check
Today
Universe
Explore
Profile