Class IntQuickSort


  • public final class IntQuickSort
    extends java.lang.Object
    IntQuickSort is an implementation of the Quick Sort algorithm as described in Donald Knuth's TAOCP with some optimizations. It supports indirect array sorting based on primitive comparators and/or key values extracted from the array values if a sort order other thant the natural one of the array elements is required. This file was automatically generated from template file primitiveSort.stg.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static int SORT_SMALL_SIZE  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private IntQuickSort()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static void insertionSort​(int[] array, int left, int right, IntComparator comparator)  
      static void sort​(int[] array, int left, int right, IntComparator comparator)  
      private static void swap​(int[] array, int i1, int i2)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IntQuickSort

        private IntQuickSort()
    • Method Detail

      • sort

        public static void sort​(int[] array,
                                int left,
                                int right,
                                IntComparator comparator)
      • insertionSort

        private static void insertionSort​(int[] array,
                                          int left,
                                          int right,
                                          IntComparator comparator)
      • swap

        private static void swap​(int[] array,
                                 int i1,
                                 int i2)