Question 7(d)(ii) 2012 · May-June · Paper 33 · 11 marks
Question 7
Part (d)
(ii)
Question 7
MAURITIUS 7
250 250
An algorithm is required to delete a value from the linked list. Examiner's Use The algorithm will use the following variables:
Identifier Data Type Description Current INTEGER Array index for the current capital
Previous INTEGER Array index for the previous capital
The following diagram shows the first three capitals in the linked list. We are about to delete CANBERRA. The list has been searched from the HeadPointer position until the capital to be deleted, CANBERRA, is found.
HeadPointer 5
BERLIN 3 CANBERRA 7 DHAKA 9 5 3 7 Etc.
Previous = 5 Current = 3
Describe the steps in the algorithm to delete CANBERRA from the linked list. (Do not attempt to write the complete algorithm.)
Question 10
4 Expressions can be written in either infix or reverse Polish notation. For Examiner's Use
Part (a)
Evaluate this reverse Polish expression:
9 6 – 5 *
Part (b)
Write the following infix expressions in reverse Polish.
(ii)
3 * 9 - 6 / 2
Part (c)
Describe one benefit of storing an expression in reverse Polish.
Part (d)
An expression in reverse Polish can be evaluated on a computer system using a stack.
(i)
Describe the operation of a stack.
(ii)
A stack is to be implemented as an array with an integer variable to point to the
‘top of stack’ index position.
State whether this is a static data structure or a dynamic data structure and explain why.
Question 11
Reveal official mark-scheme answer
The answer for this question is in the official mark scheme: open the mark scheme.
Why this question appears here
87% assigned-topic match · Data types and structures › Arrays
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 9691_s12_qp_33.pdf
