Package arc.util

Class QuickSelect<T>

java.lang.Object
arc.util.QuickSelect<T>

public class QuickSelect<T> extends Object
Implementation of Tony Hoare's quickselect algorithm. Running time is generally O(n), but worst case is O(n^2) Pivot choice is median of three method, providing better performance than a random pivot for partially sorted data. http://en.wikipedia.org/wiki/Quickselect
  • Constructor Details

    • QuickSelect

      public QuickSelect()
  • Method Details

    • select

      public int select(T[] items, Comparator<T> comp, int n, int size)