PCEP-30-02 · Question #13
An alternative name for a data structure called a stack is:
The correct answer is A. LIFO. A stack is called a LIFO (Last In, First Out) structure because the last element added is always the first one removed - like a stack of plates where you take from the top. B (FIFO) - "First In, First Out" - describes a queue, not a stack; think of a line at a checkout where…
Question
Options
- ALIFO
- BFIFO
- CFOLO
- DFIDO
How the community answered
(66 responses)- A73% (48)
- B5% (3)
- C9% (6)
- D14% (9)
Explanation
A stack is called a LIFO (Last In, First Out) structure because the last element added is always the first one removed - like a stack of plates where you take from the top.
B (FIFO) - "First In, First Out" - describes a queue, not a stack; think of a line at a checkout where the first person in is the first served.
C (FOLO) and D (FIDO) are nonsense acronyms that don't correspond to any real data structure terminology.
Memory tip: Think of a stack of pancakes - you always eat (remove) from the top, which is the last one added. "Last pancake on, first pancake eaten" = LIFO.
Community Discussion
No community discussion yet for this question.