Which one of the following permutations can be obtained the output using stack assuming that the input is the sequence 1,2,3,4,5 in that order ?
34521 is right answer
No answer because No sequence
I agree with the answer is 54321
Some one who have posted this answer has misguided us
52314 is the correct ans. for using permutations rules
this is correct answer first push 5,4,3 in the stack and then pop them ns we get 3,4,5 and then push 2,1 and we get 1,2 so answer is 3,4,5,1,2
yup R8 54321
i think there is something wrong
how it can be?
correct answer is 5,4,3,2,1 because stact is a LIFO device
Serkie Mekonnen from Dessie, Ethiopia is saying 1,5,2,3,4 is correct answer
Ashis Nayak is saying 5,4,3,1,2 is correct answer
Mu Nu is saying 5,4,3,1,2 is correct answer
Narender Kumar is saying 3,4,5,2,1 is correct answer
Marem Husen from Al Musayyib, Iraq is saying 3,4,5,2,1 is correct answer
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
Given two sorted lists of size m and n respectively.The number of comparisons needed in the worst case by the merge sort algorithm will be?
- [A] mn
- [B] max(m,n)
- [C] min(m,n)
- [D] m+n-1
- [A] Stack
- [B] Set
- [C] List
- [D] Queue
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