edu.vt.middleware.dictionary.sort
Class QuickSort

java.lang.Object
  extended by edu.vt.middleware.dictionary.sort.QuickSort
All Implemented Interfaces:
ArraySorter

public class QuickSort
extends java.lang.Object
implements ArraySorter

Provides an implementation of the quick sort algorithm.

Version:
$Revision: 1252 $ $Date: 2010-04-16 17:24:23 -0400 (Fri, 16 Apr 2010) $
Author:
Middleware Services

Constructor Summary
QuickSort()
           
 
Method Summary
 void sort(java.lang.String[] array)
          This will sort the supplied string array.
 void sort(java.lang.String[] array, java.util.Comparator<java.lang.String> c)
          This will sort the supplied string array.
static void sort(java.lang.String[] array, java.util.Comparator<java.lang.String> c, int lo, int hi)
          This will sort the supplied array beginning at the lo index and ending at the hi index, using the quick sort algorithm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuickSort

public QuickSort()
Method Detail

sort

public void sort(java.lang.String[] array)
This will sort the supplied string array.

Specified by:
sort in interface ArraySorter
Parameters:
array - To sort

sort

public void sort(java.lang.String[] array,
                 java.util.Comparator<java.lang.String> c)
This will sort the supplied string array.

Specified by:
sort in interface ArraySorter
Parameters:
array - To sort
c - Comparator to sort with

sort

public static void sort(java.lang.String[] array,
                        java.util.Comparator<java.lang.String> c,
                        int lo,
                        int hi)
This will sort the supplied array beginning at the lo index and ending at the hi index, using the quick sort algorithm.

Parameters:
array - String[] to sort
c - Comparator to sort with
lo - int index to beginning sorting at
hi - int index to stop sorting at


Copyright © 2003-2010 Virginia Tech. All Rights Reserved.