4Sorting AlgorithmsMedium4 marks
The following pseudocode algorithm uses a bubble sort to sort the array Names[50].
Complete the algorithm by choosing the missing item for each of the four blanks.
Last ← ____REPEATSwap ← ____FOR ____ ← 1 TO Last - 1IF Names[Index] > Names[Index + 1]THENTemp ← Names[Index]Names[Index] ← Names[Index + 1]Names[Index + 1] ← TempSwap ← TRUEENDIFNEXT IndexLast ← Last - 1UNTIL ____ Swap OR Last = 1
Last ←
Swap ←
FOR ← 1 TO Last - 1
UNTIL Swap OR Last = 1