lab/lab12/QuickSort.java
private static <Item extends Comparable> void partition(
            Queue<Item> unsorted, Item pivot,
            Queue<Item> less, Queue<Item> equal, Queue<Item> greater) {

        for (Item item : unsorted) {
            if (item.compareTo(pivot) < 0) {
                less.enqueue(item);
            } else if (item.compareTo(pivot) > 0) {
                greater.enqueue(item);
            } else {
                equal.enqueue(item);
            }
        }

    }
/**
     * Partitions the given unsorted queue by pivoting on the given item.
     *
     * @param unsorted  A Queue of unsorted items
     * @param pivot     The item to pivot on
     * @param less      An empty Queue. When the function completes, this queue will contain
     *                  all of the items in unsorted that are less than the given pivot.
     * @param equal     An empty Queue. When the function completes, this queue will contain
     *                  all of the items in unsorted that are equal to the given pivot.
     * @param greater   An empty Queue. When the function completes, this queue will contain
     *                  all of the items in unsorted that are greater than the given pivot.
     */
Partitions the given unsorted queue by pivoting on the given item.
@param unsorted  A Queue of unsorted items
@param pivot     The item to pivot on
@param less      An empty Queue. When the function completes, this queue will contain
all of the items in unsorted that are less than the given pivot.
@param equal     An empty Queue. When the function completes, this queue will contain
all of the items in unsorted that are equal to the given pivot.
@param greater   An empty Queue. When the function completes, this queue will contain
all of the items in unsorted that are greater than the given pivot.
Partitions the given unsorted queue by pivoting on the given item . @param unsorted A Queue of unsorted items @param pivot The item to pivot on @param less An empty Queue . When the function completes this queue will contain all of the items in unsorted that are less than the given pivot . @param equal An empty Queue . When the function completes this queue will contain all of the items in unsorted that are equal to the given pivot . @param greater An empty Queue . When the function completes this queue will contain all of the items in unsorted that are greater than the given pivot .
private static <Item extends Comparable> void partition(
            Queue<Item> unsorted, Item pivot,
            Queue<Item> less, Queue<Item> equal, Queue<Item> greater) {
        for (Item item : unsorted) {
            if (item.compareTo(pivot) < 0) {
                less.enqueue(item);
            } else if (item.compareTo(pivot) > 0) {
                greater.enqueue(item);
            } else {
                equal.enqueue(item);
            }
        }
    }
private static < Item extends Comparable > void partition ( Queue < Item > unsorted , Item pivot , Queue < Item > less , Queue < Item > equal , Queue < Item > greater ) { for ( Item item : unsorted ) { if ( item . compareTo ( pivot ) < 0 ) { less . enqueue ( item ) ; } else if ( item . compareTo ( pivot ) > 0 ) { greater . enqueue ( item ) ; } else { equal . enqueue ( item ) ; } } }
Partitions the given unsorted queue by pivoting on the given item.
Partitions the given unsorted queue by pivoting on the given item .