Correct option is C
Stacks follow the
Last-In, First-Out (LIFO) principle, where the last element added is the first to be removed. This makes the statement about "first-in, first-out" incorrect, as that describes queues.
Important Key Points:
1.
LIFO: Last element added is accessed first.
2. Stacks can be implemented using arrays or linked lists.
3. Common applications include recursion management and backtracking.
Knowledge Booster:
·
FIFO (First-In, First-Out): Followed by queues, not stacks.
· Stacks are often used in compilers for syntax checking and memory management.
· Operations on stacks include
push,
pop, and
peek.