Question DSA-CX-0002
EasyWhat is the time complexity of accessing an array element by its index?
- A.
O(log n)
- B.
O(1)
- C.
Show answer and explanation
Answer: B
The address is computed directly as base + index × element size, so access takes constant time.