Question: (b) Given that CheckStack is a stack of integers with the following private data: top: 5 items: 4 0 0 15 10 -34323 0
(b) Given that CheckStack is a stack of integers with the following private data: top: 5 items: 4 0 0 15 10 -34323 0 67823 -78999 What is the output of the following C++ code, if top is considered to be the array index of the top of the stack? int x; while (!CheckStack.isEmpty ()) CheckStack.pop (x) ; cout < < x " "; (4 marks)
Step by Step Solution
3.52 Rating (159 Votes )
There are 3 Steps involved in it
Stack operates in LIFOLast In First Out order isEmpty Function that checks whether Stack is empty or ... View full answer
Get step-by-step solutions from verified subject matter experts
