6 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
Next Question

Overall Stats

Attempted 398
Correct 104
Incorrect 78
Viewed 216


Abdelrahman S. Fathy
Abdelrahman S. Fathy - 3 months ago

Abdelrahman S. Fathy from Cairo, Egypt is saying 2,2,1,1,2 is correct answer

Sanju Rebel
Sanju Rebel - 6 months ago

Sanju Rebel from Hyderabad, India is saying 2,2,1,2,2 is correct answer

esraa nashat
esraa nashat - 7 months ago

esraa nashat from Cairo, Egypt is saying 2,2,1,1,2 is correct answer

Serkie Mekonnen
Serkie Mekonnen - 8 months ago

Serkie Mekonnen from Dessie, Ethiopia is saying 2,1,2,2,1 is correct answer

Marem Husen
Marem Husen - 9 months ago

Marem Husen from Al Musayyib, Iraq is saying 2,1,2,2,1 is correct answer

Related Questions

Which of the following statement is true ?

  • [A] Optimal binary search tree construction can be performed efficiently using dynamic programming.
  • [B] Breath first search cannot be used to find converted components of a graph.
  • [C] Given the prefix and post fix walks over a binary tree.The binary tree cannot be uniquely constructe
  • [D] Depth first search can be used to find connected components of a graph.

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

Sparse matrices have ?

  • [A] no zero
  • [B] many zero
  • [C] higher dimenstion
  • [D] none