• closed by
2,499 views
0 0 votes
closed as a duplicate of: #Push & #Pop
A queue is implemented using two stacks S1 and S2. Initially the queue contains 1, 2, 3, 4 from front

to rear. The following operations are performed in the queue: delete, insert (5), delete, Then how

many total no. of push and pop operations are needed to perform the above operation?

 

a) Push: 12 Pop: 13

b) Push: 15 Pop: 16

c) Push: 11 Pop: 10

d) Push: 12 Pop: 11

1 Answer

Position:
Show:

Related questions

2 2 votes
1 1 answer
2.7k
2.7k views
Gupta731 asked Dec 7, 2018
2,698 views
Consider a stack S given below with elements 1,2,3 along with the usual operations push(), pop() and top() as shown.The number of elements that will remain in the stack a...
2 2 votes
2 2 answers
3.2k
3.2k views
jatin khachane 1 asked Dec 1, 2018
3,172 views
My doubt : What should we consider ^ operator as Bitwise XOR ? or Exponentiation
10 10 votes
0 0 answers
2.1k
2.1k views
MiNiPanda asked Jan 25, 2018
2,137 views
Given finite alphabet S = {A, B, C} and stack S of size 100. There are only three stack operations we can perform as mentioned below.Stack is initially empty and we do no...
3 3 votes
5 5 answers
5.2k
5.2k views
Rishabh Gupta 2 asked Jan 23, 2018
5,202 views
Consider the following statements:S1: If stack is implemented as an array, all the operation push, pop, is_empty stack ( ), delete stack ( ) can be performed in constant ...