What is the time complexity of the push() operation in an array-based stack?

What is the time complexity of the push() operation in an array-based stack?

  1. A.

    O(1)

  2. B.

    O(log n)

  3. C.

    O(n log n)

  4. D.

    O(n)

Attempted by 202 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…