Package org.ddogleg.sorting
Class StraightInsertionSort
java.lang.Object
org.ddogleg.sorting.StraightInsertionSort
An implementation of the straight insert sort algorithm. This is a O(N^2) algorithm
and this implemenation originally came from NUmerical Recipes Third Edition.
page 420.
No additional data structures need to be declared. Elements are swapped in the list
Only recommended for less than 20 elements
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
sort
(double[] data) Sorts data into ascending order
-
Constructor Details
-
StraightInsertionSort
public StraightInsertionSort()
-
-
Method Details
-
sort
public static void sort(double[] data) Sorts data into ascending order
-