1.

What will be the word obtained if the word “abbcabb” is reversed using a stack?(a) bbabbca(b) abbcabb(c) bbacbba(d) bbacabbI want to ask this question from Reverse a Word using Stack topic in chapter Application of Stacks of Data Structures & Algorithms IThis question was posed to me during an online exam.

Answer»

Correct ANSWER is (C) bbacbba

Easiest EXPLANATION - The string “abbcabb” is pushed on to the STACK. If the CHARACTERS are popped one by one, the word obtained will be bbacbba.



Discussion

No Comment Found

Related InterviewSolutions