SELECTION SORT
SELECTION SORT
ÒThis type of sorting is called "Selection Sort" because it works by repeatedly element. It works as follows: first find the smallest in the array and exchange it with the element in the first position, then find the second smallest element and exchange it with the element in the second position, and continue in this way until the entire array is sorted.
EXAMPLE
a group of selection sort could be arranged in a database like this:
"Sifting down" using swaps
ÒS [8]
[1][2][5][6][?][7][4]
ANSWER:2345678
An example of insertion sort: Check each element and put it in the right place in the sorted list
ÒE SELECTION SORT
. It is the most commonly used modification of the insertion sort.
. Selection sort has a quite important application because each item is actually moved at most once
L
ÒE
ÒC
ÒT
Ò I
ÒO
ÒN
Ò
ÒS
ÒO
ÒR
T
Walang komento:
Mag-post ng isang Komento