Class DualPivotQuickSort

java.lang.Object
org.alfresco.solr.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
  • Field Details

  • Constructor Details

    • DualPivotQuickSort

      public DualPivotQuickSort()
  • Method Details

    • 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.