I'm studying for a midterm and I need help with this question:
Suppose that an intermixed sequence of push and pop operations are performed on a LIFO stack. The pushes push the numbers 0 through 9 in order; the pops print out the return value. Which of the following output sequence(s) could occur? Select all that are possible.
1 2 5 4 3 6 0 9 8 7
6 5 4 3 2 1 0 7 8 9
4 6 8 7 5 3 2 9 0 1
0 1 5 6 4 3 7 9 2 8
0 2 4 1 6 7 5 9 8 3
I believe the answer is:
6 5 4 3 2 1 0 7 8 9
Am I correct? Thank you in advance!