binarySearch
fun <T : Comparable<T>> binarySearch(list: List<T>, value: T, startIndex: Int = 0, endIndex: Int = list.size - 1): Int
Binary stringSearch, assumes that the list is sorted. Splits the list in half with every single iteration, bringing the worst case running time to O(log n)
Time complexity per case: Best - O(1), constant. In case the element is in the very middle. Average, Worst - O(log n), logarithmic.