Soal no 3
3. Selesaikanlah pengurutan dengan menggunakan Metode BUBLE SORT :
NPM : ………. MODULUS 5 = …
Tipe 0 : 17, 1,50,30,60, 5
Tipe 1 : 98,40, 5,30, 4,14
Tipe 2 : 45,56,70,10, 3,60
Tipe 3 : 30, 5,60,60,70, 1
Tipe 4 : 40,30,60,30, 4,16
Tipe 5 : 43,10,10,30,23,70
Tipe 0 : 17,1,50,30,60,5
i=0 j=4 -> T: 17,1,50,30,60,5
j=3 -> T: 1,17,50,30,60,5
i=1 j=4 -> T: 1,17,50,30,5,60
j=3 -> T: 1,17,50,5,30,60
j=2 -> T: 1,17,5,50,30,60
j=1 -> T: 1,5,17,50,30,60
i=2 j=4 -> T: 1,5,17,30,50,60
Tipe 1 : 98,40,5,30,4,14
i=0 j=4 -> F: 98,40,5,30,4,14
j=3 -> T: 98,40,5,4,30,14
j=2 -> T: 98,40,4,5,30,14
j=1 -> T: 98,4,40,5,30,14
j=0 -> T: 4,98,40,5,30,14
i=1 j=4 -> T: 4,98,5,40,30,14
j=3 -> T: 4,5,98,40,30,14
i=2 j=4 -> T: 4,5,98,40,14,30
j=3 -> T: 4,5,98,14,40,30
j=2 -> T: 4,5,14,98,40,30
i=3 j=4 -> T: 4,5,14,98,30,40
j=3 -> T: 4,5,14,30,98,40
i=4
j=4 -> T: 4,5,14,30,40,98
Tipe 2 : 45,56,70,10, 3,60
i=0 j=4 -> F: 45,56,70,10,3,60
j=3 -> T: 45,56,70,3,10,60,
j=2 -> T: 45,56,3,70,10,60
j=1 -> T: 45,3,56,70,10,60
j=0 -> T: 3,45,56,70,10,60
i=1 j=4 -> F: 3,45,56,70,10,60
j=3 -> T: 3,45,56,10,70,60
j=2 -> T: 3,45,10,56,70,60
j=1 -> T: 3,10,45,56,70,60
i=2 j=4 -> T: 3,10,45,56,60,70
j=3 -> F: 3,10,45,56,60,70
i=3 j=4 -> F: 3,10,45,56,60,70
Tipe 3 : 30, 5,60,60,70, 1
i=0 j=4 -> T: 30,5,60,60,1,70
j=3 -> T: 30,5,60,1,60,70
j=2 -> T: 30,5,1,60,60,70
j=1 -> T: 30,1,5,60,60,70
j=0 -> T: 1,30,5,60,60,70
i=1 j=4 -> T: 1,5,30,60,60,70
i=2 j=4 -> T: 1,5,30,60,60,70
j=3 -> F: 1,5,30,60,60,70
i=3 j=4 -> F: 1,5,30,60,60,70
Tipe 4 : 40,30,60,30, 4,16
i=0 j=4 -> F: 40,30,60,30,4,16
j=3 -> T: 40,30,60,4,30,16
j=2 -> T: 40,30,4,60,30,16
j=1 -> T: 40,4,30,60,30,16
j=0 -> T: 4,40,30,60,30,16
i=1 j=4 -> T: 4,40,30,60,16,30
j=3 -> T: 4,40,30,16,60,30
j=2 -> T: 4,40,16,30,60,30
j=1 -> T: 4,16,40,30,60,30
i=2 j=4 -> T: 4,16,40,30,30,60
j=3 -> T: 4,16,30,40,30,60
i=3 j=4 -> T: 4,16,30,30,40,60
Tipe 5 : 43,10,10,30,23,70
i=0 j=4 -> T:10,43,10,30,23,70
i=1 j=4 -> T:10,10,43,30,23,70
i=2 j=4 -> F:10,10,43,23,30,70
j=3 -> T:10,10,23,43,40,70
i=3 j=4 -> F:10,10,23,40,43,70