public class RecursiveBinarySearch<T extends java.lang.Comparable> extends java.lang.Object implements Search<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 |
---|
RecursiveBinarySearch() |
Modifier and Type | Method and Description |
---|---|
int |
findIndex(T[] sortedInput,
T targetElement)
Since we reduce the search space by half each time, the complexity must be in the order of O(log(n)). O(log(n)) time and space. Linear space complexity because of the implicit recursion stack. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkArray, checkIntArray, checkList