Davinder Singh - 4 years ago in Data Structure

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 ?

[A] 2,2,1,1,2
[B] 2,2,1,2,2
[C] 2,1,2,2,1
[D] 2,1,2,2,2
Loading...

Answers

Guest

Related Questions

Davinder Singh - 4 years ago in Data Structure
The initial configuration of the queue is a,b,c,d (a is the front end). To get the configuration d,c,b,a one needs a minimum of ?
  • [A] 2 deletions and 3 additions
  • [B] 3 additions and 2 deletions
  • [C] 3 deletions and 3 additions
  • [D] 3 deletions and 4 additions