Class SelectionSorter
- public class SelectionSorter
- extends ASorter
Finds the minimum od A[lo:hi], swaps it with A[lo], recur on A[lo+1:hi].
Correponds to splitting the array at the low index after putting the minimum
element there, sort the two parts, and join the sorted part. The join is trivial.
It's the splitting that requires some work. As such this selection sort belongs
to the same family as quick sort.
- Author:
- Dung X. Nguyen - Copyright 1999 - all rights reserved.

Singleton

SelectionSorter
()

join
(int[], int, int, int)
main
(String[])
split
(int[], int, int)
- Finds the minimum of A[lo:hi] and swaps it with A[lo]

Singleton
public static final SelectionSorter Singleton

SelectionSorter
private SelectionSorter()

split
public int split(int[] A, int lo, int hi)
- Finds the minimum of A[lo:hi] and swaps it with A[lo].
- Parameters:
- A -
- lo -
- hi -
- Returns:
- lo + 1, and A[lo] is the minimum of A[lo:hi].
join
public void join(int[] A, int lo, int s, int hi)
- Parameters:
- A - A[lo] is the minimum of A[lo:hi], and A[lo+1:hi] is sorted.
- lo -
- s - == lo + 1.
- hi -
main
public static void main(String[] args)