Computer Science, asked by Hahao4815, 10 months ago

If the elements A B C and D are placed in a stack and are deleted one at a time in what order will they be removed

Answers

Answered by angelaashritha1919
4

Answer:

D,C,B,A

Explanation:

Because stack follows LIFO process.

Answered by abhishekdargan
1
If A B C D are placed in stack then the result will look like this

D
C
B
A

A pile will be created.
Stack follows the concept of LIFO meaning Last In First Out. So the last element added will be removed first then the next one.

So,
D will be removed first

B
C
A

Then B

C
A


Then C

A

Then A

So the order will be
D->C->B->A
Similar questions