Kizspy | Question: 18
(Choose 1 answer)
(See picture)
A. 3
B. 4
C. 5
D. 6
E. None of the other choices is correct
FUOVERFL
In the bubble sort algorithm
procedure bubble sort (a1, a2,..., an: integers)
for i:=1 to n -1
for j:=1 to n-i if aj > aj+1 then
swap(aj,aj+1)
if the input is the list
{4, 2, 1,3}
how many swaps are used?