Figure 13 shows an algorithm represented in pseudocode.
A developer wants to check the algorithm works correctly.
Line numbers are included but are not part of the algorithm.
Figure 13
1 arr[0]
'c'
2 arr[1]
'b'
3 arr[2]
'a'
4 FOR i
0 TO 1
5 FOR j
0 TO 1
6 IF arr[j + 1] < arr[j] THEN
7 temp
arr[j]
8 arr[j]
arr[j + 1]
9 arr[j + 1]
temp
10 ENDIF
11 ENDFOR
12 ENDFOR
State the purpose of the algorithm.
Did this page help you?