org.plasma.common.sort
Class SelectionSort
java.lang.Object
org.plasma.common.sort.Sorter
org.plasma.common.sort.SelectionSort
public class SelectionSort
- extends Sorter
Selection sort algorithm
Time Complexity: O(n*n)
Memory Complexity: O(1)
Stable: yes
Note: Other implementations of the selection sort algorithm might not be stable.
|
Method Summary |
|
sort(T[] a)
|
| Methods inherited from class org.plasma.common.sort.Sorter |
swap |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SelectionSort
public SelectionSort()
sort
public <T extends Comparable<? super T>> void sort(T[] a)
- Specified by:
sort in class Sorter
Copyright © 2014. All rights reserved.