200 viewsData Structures
0
0 Comments

What will be the correct option ?

0

Some data is missing like Stack, temp1, temp2 are stacks.

loop1: pop each element from stack Stack and push in to stack temp1

loop2: pop each element from temp1 and push it in to temp2

loop3: pop each element from temp1 and push it in to Stack

so automatically data will be reversed

0
Anonymous 1 Comment

both B and D look like the answers..But they have not mentioned any code to compare initial and final contents of stack so i think it would be B.What is the answer?

reversing the stack is the ans.,, but how?