What is the time complexity for accessing an element in an array if the index…

PYQ CoCubes 2023

What is the time complexity for accessing an element in an array if the index is known?

  1. A.

    O(1)

  2. B.

    O(n)

  3. C.

    O(n log n)

  4. D.

    O(n^2)

Attempted by 1667 students.

Sign up free to check your answer

Sign up free

Explore the full course: Cdac C Cat Complete Preparation

Loading lesson…