‹ Back to the paper
Differentiate between a stack and a queue.
Answer
Answer
AIStack: a linear data structure that works on the LIFO (Last In First Out) principle; insertion (push) and deletion (pop) take place at the same end, called the top.
Queue: a linear data structure that works on the FIFO (First In First Out) principle; insertion takes place at the rear end and deletion at the front end.
From ISC 2023 Computer Science Paper 1, question 9(ii).