‹ Back to the paper
Question 2(a)
2 marks
Computer ScienceISC 2020 Specimen Computer Science Paper 1DifferentiateData structures
Differentiate between the following.
Differentiate between Stack data structure and Queue data structure.
Answer
Answer
Stack: a linear data structure that works on the LIFO (Last In First Out) principle; insertion (push) and deletion (pop) both take place at one end only, called the top, so the element added last is removed first.
Queue: a linear data structure that works on the FIFO (First In First Out) principle; insertion (enqueue) takes place at the rear end and deletion (dequeue) at the front end, so the element added first is removed first.