184k views
11 votes
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. For example"push(0); pop(); push(1)" and "push(0); push(1); pop()" are possible, but "push(1); push(0); pop()" is not possible, because 1 and 0 are out of order. Which of the following output sequence(s) could occur? Select all that are possible.

a) 12543 609 8 7 0
b) 01564 37928
c) 6543210789
d) 02416 75983
e) 46 8 75 32 901

1 Answer

0 votes

Answer:

b) 01564 37928

e) 26 8 75 32 901

Step-by-step explanation:

Pushes and pulls are the computer operations which enable the user to perform numerical tasks. The input commands are interpreted by the computer software and these tasks are converted into numeric values to generate output.

User Ryan Hill
by
5.8k points