Context for question 5
This pseudocode algorithm is intended to sort 200 names in ascending order, using a bubble sort. The last names and first names are stored in separate columns of a two‑dimensional (2D) array. The last names are stored in column 1 of the array.
// The array Names[] has already been declared as// ARRAY[1:200, 1:2] OF STRING and it is already populatedDECLARE Row : STRINGDECLARE Temp1 : STRINGDECLARE Temp2 : STRINGDECLARE Swap : BOOLEANSwap ← FALSEWHILE NOT Swap DOSwap ← FALSEFOR Row ← 2 TO 199IF Names[Row, 1] > Names[Row + 1, 1]THENTemp1 ← Names[Row, 1]Temp2 ← Names[Row, 2]Names[Row, 1] ← Names[Row + 1, 1]Names[Row, 1] ← Names[Row + 1, 2]Names[Row + 1, 1] ← Temp1Names[Row + 1, 2] ← Temp2Swap ← FALSEENDIFNEXT ColumnENDWHILE