technology medium Fill in the Blank

The time complexity of accessing an element in an array by index is ________.

  1. UPI
  2. DHCP
  3. CERT
  4. 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.

Topic Programming Logic
Exam Relevance SSC JE, Banking IT, Railway