448 views
1 votes
1 votes

The following sequence of operation is performed on stack : push(1),push(2),pop,push(1),push(2),pop,pop,pop,push(2),pop.

The sequence of popped out values are?

  1. 2,1,2,2,1
  2. 2,1,2,2,2
  3. 2,2,1,1,2
  4. 2,2,1,2,2

Please log in or register to answer this question.

Answer:

Related questions

0 votes
0 votes
1 answer
2
Bikram asked Nov 26, 2016
1,641 views
Three algorithms do the same task. Algorithm One is $O(N)$ and Algorithm Two is $O(\log N)$ and Algorithm Three is $O(N1/2)$. Which algorithm should execute the fastest f...
1 votes
1 votes
3 answers
3
0 votes
0 votes
0 answers
4