Show how bubble sort algorithm orders these numbers from lea
Show how bubble sort algorithm orders these numbers from least to greatest:
17, 14, 18, 13, 12, 20
Solution
here are the steps for
outer for loop iteration1
17, 14, 18, 13, 12, 20
14, 17, 18, 13, 12, 20
14, 17, 13, 18, 12, 20
14, 17, 13, 12, 18, 20
Iternation2:
14, 13, 17, 12, 18, 20
14, 13, 12, 17, 18, 20
Iteration 3:
13, 14, 12, 17, 18, 20
13, 12, 14, 17, 18, 20
iteration 4:
12, 13, 14, 17, 18, 20
