ITPEC IP October 2020 Question 9

Source exam: ITPEC IP October 2020Topic: Algorithm and Programming

ITPEC IP October 2020 — Question 9 of 100

A stack retrieves the item stored most recently first, which is last in, first out. Both insertion and removal occur at the same end, called the top: a push adds a new top item and a pop removes the current top item.

Answer (b)

Why not others:
- arbitrary-position retrieval describes random access rather than stack access

- first-in, first-out behavior belongs to a queue

- extracting by key priority belongs to a priority queue or similar keyed structure

Key rule: Stack = LIFO, queue = FIFO; remember a stack like a pile where only the top item is directly removed.

AI-generated — may contain errors

The original exam layout is preserved in the image so diagrams, formulas, tables, and code remain accurate.

This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official IP past-paper collection or Report an issue.