Class selectionSort

java.lang.Object
  |
  +--sort
        |
        +--selectionSort

public class selectionSort
extends sort

This class implements the Selection Sort algorithm The Source code


Fields inherited from class sort
C
 
Constructor Summary
selectionSort(comparable C)
          Constructor for the selectionSort class
 
Method Summary
 void sortit()
          Selection sorting routine.
 
Methods inherited from class sort
swap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

selectionSort

public selectionSort(comparable C)
Constructor for the selectionSort class
Method Detail

sortit

public void sortit()
Selection sorting routine. The method's logic is quite simple minded. It finds the smallest element and puts it in the begining. Then finds the second smallest element and puts it next to it. It will carry on like this until the whole list is sorted.
Overrides:
sortit in class sort