An algorithm to sort a 1D array into ascending order is described as follows: • move the largest value to the end • keep repeating until the array is sorted. Apply the process of stepwise refinement to this algorithm in order to produce a more detailed description. Write the more detailed description using structured English. Your explanation of the algorithm should not include pseudocode statements.
- (a)An algorithm to sort a 1D array into ascending order is described as follows: • move the largest value to the end • keep repeating until the array is sorted. Apply the process of stepwise refinement to this algorithm in order to produce a more detailed description. Write the more detailed description using structured English. Your explanation of the algorithm should not include pseudocode statements.[6]
- (b)The program flowchart shown describes a simple algorithm. [Figure 2.1 - Flowchart] Write pseudocode for the simple algorithm shown on page 6.[6]
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 (Oct/Nov 2021). The mark or mark type is shown in brackets.
- [1] One mark for reference to:
- The use a variable as an index to the array
- A loop to iterate through the array
- An Inner loop (with a reducing range)
- Test if current element is greater than next element
- if so then swap elements
- Description of swap
- Attempt at efficient algorithm
- Max 6 marks
- [1] One mark per point:
- Initialisation of Count AND Flag
- WHILE ... ENDWHILE // REPEAT ... UNTIL loop
- including both conditions
- Call ReBoot () AND increment Count inside the loop
- Assign return value from Check() to Flag inside the loop
- Final test of Flag AND call to Alert(27) not in a loop
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 →