Package velo.ladaalpha.misc
Class SortingAlgorithms
java.lang.Object
velo.ladaalpha.misc.SortingAlgorithms
The Class SortingAlgorithms.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic double[]bubbleSort(double[] arr) Bubble sort.static double[]insertionSort(double[] arr) Insertion sort.static double[]mergeSort(double[] array, int lowval, int highval) Merge sort.static double[]selectionSort(double[] arr) Selection sort.
-
Constructor Details
-
SortingAlgorithms
public SortingAlgorithms()
-
-
Method Details
-
insertionSort
public static double[] insertionSort(double[] arr) Insertion sort.- Parameters:
arr- the arr- Returns:
- the double[]
-
bubbleSort
public static double[] bubbleSort(double[] arr) Bubble sort.- Parameters:
arr- the arr- Returns:
- the double[]
-
selectionSort
public static double[] selectionSort(double[] arr) Selection sort.- Parameters:
arr- the arr- Returns:
- the double[]
-
mergeSort
public static double[] mergeSort(double[] array, int lowval, int highval) Merge sort.- Parameters:
array- the arraylowval- the lowvalhighval- the highval- Returns:
- the double[]
-