wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

If stack is empty, then after POP

A
Under flow
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
B
Over flow
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
both 1 and 2
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
None of these
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is A Under flow

A stack is an abstract data type that serves as a collection of elements, with two principal operations: push, which adds an element to the collection, and. pop, which removes the most recently added element that was not yet removed.


Underflow happens when we try to pop an item from an empty stack. If top is less than zero this means that an uncaught underflow has occurred.


942486_916918_ans_860c6c8ad33e40da9c5809e91a5b6a3b.PNG

flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Gravity Separation
CHEMISTRY
Watch in App
Join BYJU'S Learning Program
CrossIcon