Question 1
AQA Computer Science June 2025 Paper 1 (7516/1)AS3 marks
On the specification
- 3.4 Theory of computation3.2 Fundamentals of data structures
Question text
1 Figure 1 shows the data structures Letter, L and R used by the algorithm shown in Figure 2. Figure 1 Letter L R [0] [0] 5 [0] 20 [1] A [1] 18 [1] 23 [2] B [2] -1 [2] -1 [3] C [3] -1 [3] -1 [4] D [4] 2 [4] 24 [5] E [5] 9 [5] 1 [6] F [6] -1 [6] -1 [7] G [7] 26 [7] 17 [8] H [8] -1 [8] -1 [9] I [9] 19 [9] 21 [10] J [10] -1 [10] -1 [11] K [11] 3 [11] 25 [12] L [12] -1 [12] -1 [13] M [13] 7 [13] 15 [14] N [14] 4 [14] 11 [15] O [15] -1 [15] -1 [16] P [16] -1 [16] -1 [17] Q [17] -1 [17] -1 [18] R [18] 12 [18] -1 [19] S [19] 8 [19] 22 [20] T [20] 14 [20] 13 [21] U [21] 6 [21] -1 [22] V [22] -1 [22] -1 [23] W [23] 16 [23] 10 [24] X [24] -1 [24] -1 [25] Y [25] -1 [25] -1 [26] Z [26] -1 [26] -1 Figure 2 M ← "1001" Current ← 0 FOR i ← 0 TO 3 Symbol ← M[i] IF Symbol = "0" THEN Current ← L[Current] ELSE Current ← R[Current] ENDIF ENDFOR OUTPUT Letter[Current] Complete Table 1 by hand-tracing the algorithm in Figure 2. The strings are zero index based. For example, the character with index 0 in the string "ABCD" is "A". You may not need to use all the rows in Table 1. The first row of Table 1 has already been completed for you. Table 1 M i Symbol Current Output "1001" 0 Copy the contents of all the unshaded cells in Table 1 into your Electronic Answer Document. [3 marks]