1.
What is the time complexity of accessing an element by index in an array?
A
O(n)
B
O(log n)
C
O(1)
D
O(n²)
Answer and explanation
Correct Answer: C — O(1)
Arrays support direct index-based access. The memory address is calculated as base_address + index × element_size, making it O(1).
