Stack data structure uses
2023
Stack data structure uses
- A.
FIFO
- B.
LIFO
- C.
LILO
- D.
None of the above
- E.
More than one of the above
Attempted by 1575 students.
Show answer & explanation
Correct answer: B
A stack is a linear data structure that follows a particular order in which operations are performed. The order is LIFO (Last In, First Out), meaning the last element added is the first one to be removed. In a stack, elements are added and removed from the same end, called the top. When an element is added, it is placed on top of the stack. When an element is removed, it is removed from the top. This behavior is different from a queue, which follows FIFO (First In, First Out). Therefore, the stack data structure uses the LIFO principle.