The time complexity of accessing an element in an array by index is ________.
- UPI
- DHCP
- CERT
- O(1)
Answer: O(1)
Array access by index is O(1) constant time because memory address is calculated directly: base_address + index * element_size. No traversal needed. Contrasts with linked lists (O(n) for access). This efficiency makes arrays ideal for random access patterns, but insertion/deletion in middle is O(n) due to element shifting.