Class QuickSelect<T>


  • public class QuickSelect<T>
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      QuickSelect()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int select​(T[] items, java.util.Comparator<T> comp, int n, int size)  
      • Methods inherited from class java.lang.Object

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

      • QuickSelect

        public QuickSelect()
    • Method Detail

      • select

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