juniorArrays
What is the time complexity of accessing elements in an array?
Updated Apr 28, 2026
Short answer
Accessing an element in an array takes O(1) time.
Deep explanation
Since arrays use contiguous memory, the address of any element can be directly computed, making access constant time.
Real-world example
Accessing a student's marks by index.
Common mistakes
- Confusing access with search.
Follow-up questions
- What is search complexity?
- Why O(1)?