Package dsa

Class Quick3way


  • public class Quick3way
    extends Object
    This library implements quick-3-way sort.
    • Constructor Detail

      • Quick3way

        public Quick3way()
    • Method Detail

      • sort

        public static void sort​(Comparable[] a)
        Sorts the array a according to the natural order of its objects.
        Parameters:
        a - the array to sort.
      • sort

        public static void sort​(Object[] a,
                                Comparator c)
        Sorts the array a according to the order induced by the comparator c.
        Parameters:
        a - the array to sort.
        c - the comparator to determine the order of the array.
      • sort

        public static void sort​(int[] a)
        Sorts the array a.
        Parameters:
        a - the array to sort.
      • sort

        public static void sort​(double[] a)
        Sorts the array a.
        Parameters:
        a - the array to sort.
      • main

        public static void main​(String[] args)
        Unit tests the library.
        Parameters:
        args - the command-line arguments.