Practice mode Data Structures

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.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.