A 1D array Data of type integer contains 200 elements. Each element has a unique value. An algorithm is required to search for the largest value and output it. Describe the steps that the algorithm should perform. Do not include pseudocode statements in your answer.
Mark scheme
Marking points from the official mark scheme (Oct/Nov 2022). The mark or mark type is shown in brackets.
- [1] Declare a variable / an integer Max
- [1] Assign value of first / any element to Max
- [1] Set up a loop to repeat 200 times / from start to end of array
- [1] Use the loop counter as the array index
- [1] If value of current element is greater than Max...
- [1] ...then assign value to Max
- [1] After the loop, Output Max
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 →