Question 7(b) 2021 · May-June · Paper 41 · 3 marks
Reveal official mark-scheme answer
Official answer for Question 7
Part (b)
Question 1
mark per bullet point
Question 3
- Function header (and end taking array and pointer by reference) and checking stack empty …
- … if empty, return −1
- … if not empty, return topOfStack data item from stack and decrement pointer
Show text version of question
Question 7
Part (b)
Question 7
Giles is writing a program that uses a stack.
The stack stores up to 1000 integers in the 1D array, stackArray.
Part (b)
The function pop() pops and returns the item from the top of the stack. If the stack is empty,
it returns −1.
Write pseudocode for the function pop().
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................
Question 19
Question 20
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.
Why this question appears here
71% assigned-topic match · Programming › Constructs
Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.
Permanent source page: Educate A Change · From 9608_s21_qp_41.pdf
