Class DualPivotQuickSort


  • public class DualPivotQuickSort
    extends Object
    Implementation of the Dual Pivot Quick Sort algorithm, based on the paper by Vladimir Yaroslavskiy, available at DualPivotQuicksort.pdf. This provides an in-place sorting mechanism, to allow the reuse of arrays containing a large number of objects, reducing the number of temporary object created by the Alfresco Solr indexing service.
    Author:
    Alex Miller
    • Constructor Detail

      • DualPivotQuickSort

        public DualPivotQuickSort()
    • Method Detail

      • sort

        public static <T> void sort​(T[] elements,
                                    Comparator<T> comparator)
        Sort elements using comparator, in place.
      • sort

        public static <T> void sort​(T[] elements,
                                    int left,
                                    int right,
                                    Comparator<T> comparator)
        Sort elements between index left and index right, using comparator.