Consider the following sequence of push and pop operations on an initially…
Consider the following sequence of push and pop operations on an initially empty stack S.S = push(S,1);S = pop(S);S = push(S,2);S = push(S,3);S = pop(S);S = push(S,4);S = pop(S);S = pop(S);Which of the following is the correct order in which elements are popped?
- A.
1, 2, 3, 4
- B.
1, 3, 2, 4
- C.
1, 3, 4, 2
- D.
4, 3, 2, 1
Attempted by 679 students.
Sign up free to check your answer
Sign up freeLoading lesson…