Data Structure Stacks Question #5748
MCQ Single Best Answer Easy

QWhat is the time complexity of the push and pop operations on a stack implemented using an array?

ID: #5748 Stacks 151 views
Question Info
#5748Q ID
EasyDifficulty
StacksTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A O(1)
  • B O(log n)
  • C O(n)
  • D O(n log n)
Correct Answer: Option A

Explanation

Answer: a) O(1)

Explanation: The push and pop operations on a stack implemented using an array have a time complexity of O(1), since they simply involve adding or removing an element from the end of the array.

Share This Question

Challenge a friend or share with your study group.