org.plasma.common.sort
Class Sort

java.lang.Object
  extended by org.plasma.common.sort.Sort

public class Sort
extends Object

These algorithms can be used to sort an array of any primitive datatype / Comparable Object. The datatype conversions for the arrays won't influence the time complexity of the sorting algorithms. Without these conversions, the algorithms would have to be re-written for every primitive datatype.


Constructor Summary
Sort()
           
 
Method Summary
static boolean[] bubbleSort(boolean[] a)
           
static byte[] bubbleSort(byte[] a)
           
static char[] bubbleSort(char[] a)
           
static double[] bubbleSort(double[] a)
           
static float[] bubbleSort(float[] a)
           
static int[] bubbleSort(int[] a)
           
static long[] bubbleSort(long[] a)
           
static
<T extends Comparable<? super T>>
void
bubbleSort(T[] a)
           
static boolean[] insertionSort(boolean[] a)
           
static byte[] insertionSort(byte[] a)
           
static char[] insertionSort(char[] a)
           
static double[] insertionSort(double[] a)
           
static float[] insertionSort(float[] a)
           
static int[] insertionSort(int[] a)
           
static long[] insertionSort(long[] a)
           
static
<T extends Comparable<? super T>>
void
insertionSort(T[] a)
           
static boolean[] mergeSort(boolean[] a)
           
static byte[] mergeSort(byte[] a)
           
static char[] mergeSort(char[] a)
           
static double[] mergeSort(double[] a)
           
static float[] mergeSort(float[] a)
           
static int[] mergeSort(int[] a)
           
static long[] mergeSort(long[] a)
           
static
<T extends Comparable<? super T>>
void
mergeSort(T[] a)
           
static boolean[] quickSort(boolean[] a)
           
static byte[] quickSort(byte[] a)
           
static char[] quickSort(char[] a)
           
static double[] quickSort(double[] a)
           
static float[] quickSort(float[] a)
           
static int[] quickSort(int[] a)
           
static long[] quickSort(long[] a)
           
static
<T extends Comparable<? super T>>
void
quickSort(T[] a)
           
static boolean[] selectionSort(boolean[] a)
           
static byte[] selectionSort(byte[] a)
           
static char[] selectionSort(char[] a)
           
static double[] selectionSort(double[] a)
           
static float[] selectionSort(float[] a)
           
static int[] selectionSort(int[] a)
           
static long[] selectionSort(long[] a)
           
static
<T extends Comparable<? super T>>
void
selectionSort(T[] a)
           
static boolean[] shellSort(boolean[] a)
           
static byte[] shellSort(byte[] a)
           
static char[] shellSort(char[] a)
           
static double[] shellSort(double[] a)
           
static float[] shellSort(float[] a)
           
static int[] shellSort(int[] a)
           
static long[] shellSort(long[] a)
           
static
<T extends Comparable<? super T>>
void
shellSort(T[] a)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sort

public Sort()
Method Detail

bubbleSort

public static <T extends Comparable<? super T>> void bubbleSort(T[] a)

bubbleSort

public static int[] bubbleSort(int[] a)

bubbleSort

public static long[] bubbleSort(long[] a)

bubbleSort

public static double[] bubbleSort(double[] a)

bubbleSort

public static float[] bubbleSort(float[] a)

bubbleSort

public static char[] bubbleSort(char[] a)

bubbleSort

public static boolean[] bubbleSort(boolean[] a)

bubbleSort

public static byte[] bubbleSort(byte[] a)

selectionSort

public static <T extends Comparable<? super T>> void selectionSort(T[] a)

selectionSort

public static int[] selectionSort(int[] a)

selectionSort

public static long[] selectionSort(long[] a)

selectionSort

public static double[] selectionSort(double[] a)

selectionSort

public static float[] selectionSort(float[] a)

selectionSort

public static char[] selectionSort(char[] a)

selectionSort

public static boolean[] selectionSort(boolean[] a)

selectionSort

public static byte[] selectionSort(byte[] a)

insertionSort

public static <T extends Comparable<? super T>> void insertionSort(T[] a)

insertionSort

public static int[] insertionSort(int[] a)

insertionSort

public static long[] insertionSort(long[] a)

insertionSort

public static double[] insertionSort(double[] a)

insertionSort

public static float[] insertionSort(float[] a)

insertionSort

public static char[] insertionSort(char[] a)

insertionSort

public static boolean[] insertionSort(boolean[] a)

insertionSort

public static byte[] insertionSort(byte[] a)

shellSort

public static <T extends Comparable<? super T>> void shellSort(T[] a)

shellSort

public static int[] shellSort(int[] a)

shellSort

public static long[] shellSort(long[] a)

shellSort

public static double[] shellSort(double[] a)

shellSort

public static float[] shellSort(float[] a)

shellSort

public static char[] shellSort(char[] a)

shellSort

public static boolean[] shellSort(boolean[] a)

shellSort

public static byte[] shellSort(byte[] a)

mergeSort

public static <T extends Comparable<? super T>> void mergeSort(T[] a)

mergeSort

public static int[] mergeSort(int[] a)

mergeSort

public static long[] mergeSort(long[] a)

mergeSort

public static double[] mergeSort(double[] a)

mergeSort

public static float[] mergeSort(float[] a)

mergeSort

public static char[] mergeSort(char[] a)

mergeSort

public static boolean[] mergeSort(boolean[] a)

mergeSort

public static byte[] mergeSort(byte[] a)

quickSort

public static <T extends Comparable<? super T>> void quickSort(T[] a)

quickSort

public static int[] quickSort(int[] a)

quickSort

public static long[] quickSort(long[] a)

quickSort

public static double[] quickSort(double[] a)

quickSort

public static float[] quickSort(float[] a)

quickSort

public static char[] quickSort(char[] a)

quickSort

public static boolean[] quickSort(boolean[] a)

quickSort

public static byte[] quickSort(byte[] a)


Copyright © 2014. All rights reserved.