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

Overall Stats

Attempted 255
Correct 73
Incorrect 43
Viewed 139

Answers

Guest
Guest
Pkchandiya Brahman
Pkchandiya Brahman - 1 month ago

Pkchandiya Brahman from Larkana, Pakistan is saying 2,1,2,2,1 is correct answer

Cécile Musabyemariya
Cécile Musabyemariya - 3 months ago

Cécile Musabyemariya is saying 2,2,1,1,2 is correct answer

Lets Know
Lets Know - 4 years ago

Lets Know from Pakistan is saying 2,2,1,1,2 is correct answer

Rohan Bhosale
Rohan Bhosale - 4 years ago

Rohan Bhosale from Pune, India is saying 2,2,1,1,2 is correct answer

Mihir Shah
Mihir Shah - 4 years ago

Mihir Shah from Majalgaon, India is saying 2,2,1,1,2 is correct answer

Related Questions

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

Merge sort uses ?

  • [A] Divide and conquer strategy
  • [B] Backtracking approach
  • [C] Heuristic search
  • [D] Greedy approach

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