0% found this document useful (0 votes)
7 views1 page

Selection Sort Flowchart Example

The document describes a selection sort algorithm for sorting data. It initializes variables like x, Z, and the total number of elements. It then compares the first and last elements, swaps them if out of order, and iterates through the array, swapping adjacent elements and incrementing x until fully sorted.

Uploaded by

BagusHermawan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Selection Sort Flowchart Example

The document describes a selection sort algorithm for sorting data. It initializes variables like x, Z, and the total number of elements. It then compares the first and last elements, swaps them if out of order, and iterates through the array, swapping adjacent elements and incrementing x until fully sorted.

Uploaded by

BagusHermawan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Start

Start

x = 0 , Z = n - 1
Jumlah elemen = n

A = data [x]
i = 0
B = data [Z]

Masukkan data ke i
=> x T
A > B

Y
Z= Z-1
data [ i ] = x
i = i + 1

data [x] = B
T
data [Z] = A
i = n-1

T
Y
Z = x+1
Tampilkan data [ i ]
z= n-1
Y

Y
Proses Pengurutan x=0 x=1
( Selection Sort )
T

x= x+1
Tampilkan
data [ i ] hasil
Sorting T
x = n-1

Y
End
End

You might also like