Which data structure operates on a Last-In, First-Out (LIFO) access principle?

Answer and explanation

Correct answer: D. Stack

  1. Step 1: A Stack allows insertion (push) and deletion (pop) exclusively at one end called the top.
  2. Step 2: The element added most recently is the first one removed, defining the LIFO principle.
Answer
Stack.
Why not the others: 'Queue' operates on First-In, First-Out (FIFO); 'Linked List' allows insertion/deletion at any node; 'Binary Heap' prioritizes elements by key priority.

Practise more Python Programming, Data Structures, Algorithms, Networks and Cybersecurity.

Free questions with an explanation for every one, and full timed Saudi Secondary School Certificate mock tests.