M

Mr. Dubey • 52.30K Points
Coach

Q. Which of the following takes O(n) time in worst case in array implementation of stack?

(A) pop
(B) push
(C) isempty
(D) pop, push and isempty takes constant time
Correct : Option (D)

Explanation:
 functions pop, push and isempty all are implemented in constant time in worst case.

Share

Discusssion

Login to discuss.

Be the first to start discuss.