MCQ
Single Best Answer
Easy
QWhat is the time complexity of a push operation in a stack implemented using an array?
ID: #15254
Time Complexity
137 views
Question Info
#15254Q ID
EasyDifficulty
Time ComplexityTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer: Option A
Explanation
In a stack implemented using an array, the push operation inserts an element at the top of the stack. Since the top position is known, the push operation can be performed in constant time by simply incrementing the top index and storing the element in the corresponding array position. Therefore, the time complexity of the push operation is O(1).
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic