# Different Sorts (Bubble, Insertion...)

• Oct 21st 2006, 12:02 PM
Ideasman
Different Sorts (Bubble, Insertion...)
From the following values,

a_1, a_2, a_3, a_4, a_5, a_6, a_7, a_8, where

a_1 = 37
a_2 = 21
a_3 = 5
a_4 = 19
a_5 = 8
a_6 = 16
a_7 = 24
a_8 = 35

Show the contents of the above after the 4th iteration of the following:

a.) insertion sort
b.) bubble sort
c.) selection sort

And then show 4 interactions (that is, trees), of the Tournament Sort of the same array above.
• Oct 22nd 2006, 12:55 AM
Glaysher
Quote:

Originally Posted by Ideasman
From the following values,

a_1, a_2, a_3, a_4, a_5, a_6, a_7, a_8, where

a_1 = 37
a_2 = 21
a_3 = 5
a_4 = 19
a_5 = 8
a_6 = 16
a_7 = 24
a_8 = 35

Show the contents of the above after the 4th iteration of the following:

a.) insertion sort
b.) bubble sort
c.) selection sort

And then show 4 interactions (that is, trees), of the Tournament Sort of the same array above.

Only know bubble sort, assuming ascending order

37 21 5 19 8 16 24 35
21 37
21 5 37
21 5 19 37
21 5 19 8 37
21 5 19 8 16 37
21 5 19 8 16 24 37
21 5 19 8 16 24 35 37
5 21
5 19 21
5 19 8 21
5 19 8 16 21
5 19 8 16 21 24 35 37
5 8 19
5 8 16 19 21 24 35 37