Professional Documents
Culture Documents
Contoh 1.1 Source Code Java Selection Sort: Public Class Int Public
Contoh 1.1 Source Code Java Selection Sort: Public Class Int Public
Contoh 1.1 Source Code Java Selection Sort: Public Class Int Public
PD PD
!
W
W
O
O
N
N
y
y
bu
bu
to
to
ww
ww
om
om
k
k
lic
lic
CONTOH 1.1 SOURCE CODE JAVA { SELECTION SORT}
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
tampilkanAngka ();
urutkanAngka ();
tampilkanAngka ();
void tampilkanAngka () {
System.out.println("\n--------------------------------");
for (int i=0;i<angka.length;i++)
{
System.out.print(angka[i]+" ");
}
void urutkanAngka() {
int tampung;
if(minindek!=i){
tampung= angka[i];
angka[i]= angka[minindek];
angka[minindek]= tampung;
}
} //tampilkanAngka();
{
selectionSort urut = new selectionSort();
}
F -X C h a n ge F -X C h a n ge
PD PD
!
W
W
O
O
N
N
y
y
bu
bu
to
to
ww
ww
om
om
k
k
lic
lic
CONTOH 1.2 SOURCE CODE JAVA { SELECTION SORT}
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
Int n = 0;
Int nilai [] = { 44, 55, 12, 42, 94, 18, 06, 67};
Pos=i;
Pos=j;
If ( pos !=1 ) {
System.out.print(“hasil= “);
System.out.println(“ “);