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
4
Answer:
D,C,B,A
Explanation:
Because stack follows LIFO process.
Answered by
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
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
Hindi,
5 months ago
Social Sciences,
5 months ago
Math,
5 months ago
Math,
10 months ago
Social Sciences,
10 months ago
Social Sciences,
1 year ago
Social Sciences,
1 year ago
English,
1 year ago