1.

If the elements “A”, “B”, “C” and “D” are placed in a stack and are deleted one at a time, what is the order of removal?(a) ABCD(b) DCBA(c) DCAB(d) ABDCThis intriguing question comes from Stack Operations in chapter Abstract Data Types of Data Structures & Algorithms IThis question was addressed to me in homework.

Answer» RIGHT CHOICE is (B) DCBA

The explanation is: Stack follows LIFO(Last In First Out). So the removal order of elements are DCBA.


Discussion

No Comment Found

Related InterviewSolutions