public class BruteForceMedianFinder<T extends java.lang.Comparable> extends java.lang.Object implements MedianFinder<T>
ARRAY_IS_EMPTY, DATA_TYPE_NOT_SUPPORTED_YET, DECIMAL_RADIX, DELIMITER_COMMA, ELEMENT_NOT_FOUND, LIST_IS_EMPTY, OPERATION_NOT_SUPPORTED_YET
Constructor and Description |
---|
BruteForceMedianFinder() |
Modifier and Type | Method and Description |
---|---|
T |
findKthSmallest(T[] objects,
int k)
QuickSelect based default implementation for findKthSmallest problem. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
findMaximum, findMedian, findMinimum
findKthLargest, kCheck, medianOf3, pivotSort, quickSelect
checkArray, checkIntArray, checkList
public T findKthSmallest(T[] objects, int k)
QuickSelect
findKthSmallest
in interface QuickSelect<T extends java.lang.Comparable>
objects
- input arrayk
- 3rd smallest = 3, when objects:[1,2,3,4,5] and k=3