Package-level declarations

Functions

Link copied to clipboard
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)

Link copied to clipboard
fun <T : Comparable<T>> ArrayList<T>.binarySearch(value: T, range: IntRange = indices): Int?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun <T> plainSearch(list: List<T>, value: T): Int

Plain list stringSearch. Goes through every single element and finds the index of the value by comparing the current element in the loop with the value.