The flowchart represents an algorithm. [Figure 7.1 - Flowchart diagram showing the algorithm's flow] The table represents the two-dimensional (2D) array Word[] which stores the first half of the phonetic alphabet used for radio transmission. For example, Word [10,1] is 'J'. | Index | 1 | 2 | |-------|---|---------| | 1 | A | Alpha | | 2 | B | Bravo | | 3 | C | Charlie | | 4 | D | Delta | | 5 | E | Echo | | 6 | F | Foxtrot | | 7 | G | Golf | | 8 | H | Hotel | | 9 | I | India | | 10 | J | Juliet | | 11 | K | Kilo | | 12 | L | Lima | | 13 | M | Mike |
- (a)Complete the trace table for the algorithm by using the input data: F, Y, D, N Pointer | Letter | Choice | OUTPUT[4]
- (b)Identify the type of algorithm used.[1]
- (c)Describe one problem that could occur with this algorithm if an invalid character was input.[2]
This question uses a diagram from the original paper, which isn't shown here. Open the full paper from the past papers archive to see it.
Mark scheme
Marking points from the official mark scheme (May/June 2023). The mark or mark type is shown in brackets.
- [1] (a) Correct trace for input 'F' leading to output "Letter F is represented by Foxtrot"
- [1] (a) Correct trace for choice 'Y' leading to reset Pointer=1
- [1] (a) Correct trace for input 'D' leading to output "Letter D is represented by Delta"
- [1] (a) Correct trace for choice 'N' leading to STOP
- [1] (b) (Linear) search
- [1] (c) The algorithm would not stop / it would not have found the item it was seeking
- [1] (c) Or: The array would run out of values after the pointer reached 13 / the algorithm will crash
Write your answer and get it marked
On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.
Sign up free →