Question 3(c) 2022 · October-November · Paper 22 · 5 marks
Reveal official mark-scheme answer
Official answer for Question 3
Part (c)
Question 5
Question 1
Question 2
Question 3
Question 4
Question 5
Show text version of question
Question 3
Part (c)
Question 3
A stack is used in a program to store string data which needs to be accessed in several modules.
Part (c)
A second stack is used in the program. The diagram below shows the initial state of this
stack. Value X is at the top of the stack and was the last item added.
Upper-case letters are used to represent different data values.
Stack operations are performed in three groups as follows:
Group 1: PUSH D PUSH E
Group 2: POP POP POP
Group 3: PUSH A PUSH B POP PUSH C
Complete the diagram to show the state of the stack after each group of operations has been performed.
Include the current stack pointer (SP) after each group.
Memory Initial After After After location state Group 1 Group 2 Group 3
957
956
955
954
953 X ←SP 952 Y
951 Z
950 P
Question 7
Question 8
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 9618_w22_qp_22.pdf
