+1 vote
in Data Structures & Algorithms I by (110k points)
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) ABDC

This intriguing question comes from Stack Operations in chapter Abstract Data Types of Data Structures & Algorithms I

This question was addressed to me in homework.

1 Answer

+1 vote
by (412k points)
selected by
 
Best answer
Right choice is (b) DCBA

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

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.

Categories

...