Which principle does a stack follow?
Correct answer A. Last In, First Out (LIFO)
Explanation
A stack adds and removes items at the same end, called the top, so the most recently pushed item is the first one popped: last in, first out. A queue is the FIFO structure, removing the oldest item first. Priority-based removal describes a priority queue, which is a different abstract data type.
Answer checked How we write and check questions
Discussion