Computer Science · May / June 2024 · Paper 21 · Question 6
0478
As printed in the paper
The question as text
The flowchart represents an algorithm. INPUT Limit Count 1 No START STOP OUTPUT Numbers[Result] INPUT Numbers[Count] Result Limit DIV 2 + 1 Swap Numbers[Count] Numbers[Count] Numbers[Count + 1] Numbers[Count + 1] Swap Flag True Count Count + 1 IS Count > Limit? Count Count + 1 Flag TRUE Yes No No No Yes Yes Yes Flag False Count 1 IS Numbers[Count] > Numbers[Count + 1]? IS Count > Limit – 1? IS Flag = TRUE?
Read automatically from the paper; the printed page above is exact.
Show the answer and mark scheme
6(a)[7]
One mark per mark point
MP1 Correct Limit column
MP2 Correct Count column
MP3 Array columns for input stage
MP4 Array columns for sort stage
MP5 Correct Flag column
MP6 Correct Swap column
MP7 Correct Result and OUTPUT columns
Numbers
Limit
Count
[1] [2] [3] [4] [5] [6] [7]
Flag
Swap
Result
OUTPUT 7
1
47
2
50
3
52
4
60
5
80
6
63
7
70
8
TRUE
1
FALSE
2
3
4
Numbers
Limit
Count
[1]
[2]
[3]
[4]
[5]
[6]
[7]
Flag
Swap
Result
OUTPUT 5
80
63
80
TRUE
6
80
70
80
TRUE
7
1
FALSE
2
3
4
5
6
7
4
60
6(b)[3]
One mark per mark point
A set of numbers is input / stored in an arrayThe numbers are sorted / Bubble sort into (ascending) orderThe middle / median value is found / output
Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.

