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
Answer» D. pop, push and isempty takes constant time
Explanation: functions pop, push and isempty all are implemented in constant time in worst case.
862
0
Do you find this helpful?
1

Discussion

No comments yet