Davinder Singh - 4 years ago in Data Structure

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 ?

[A] 3,4,5,1,2
[B] 3,4,5,2,1
[C] 1,5,2,3,4
[D] 5,4,3,1,2
Loading...

Answers

Guest
shengqiushuang - 1 year ago

I agree with the answer is 54321

Nitesh Patel - 1 year ago

Some one who have posted this answer has misguided us

Suthar Bhanwar Mlm - 1 year ago

http://www.emis.de/journals/EJC/Volume_13/PDF/v13i1r68.pdf

Suthar Bhanwar Mlm - 1 year ago

52314 is the correct ans. for using permutations rules

Lalit Kumar - 2 years ago

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

Ajaysing Rajput - 2 years ago

yup R8 54321

Ayush Rathi - 2 years ago

i think there is something wrong

Ayush Rathi - 2 years ago

how it can be?

Zaheer Abbas - 2 years ago

correct answer is 5,4,3,2,1 because stact is a LIFO device

Related Questions

Davinder Singh - 4 years ago in Data Structure
Which of the following algorithm design technique is used in the quick sort algorithm?
  • [A] Dynamic programming
  • [B] Backtracking
  • [C] Divide and conquer
  • [D] Greedy method
Davinder Singh - 4 years ago in Data Structure
A vertex of degree one is called
  • [A] padent
  • [B] isolated vertex
  • [C] null vertex
  • [D] colored vertex
Davinder Singh - 4 years ago in Data Structure
Queue can be used to implement ?
  • [A] quick sort
  • [B] merge sort
  • [C] heap sort
  • [D] insertion sort