Big O is the notation that describes an upper bound on how an algorithm's running time or memory use grows as the…
Binary search finds a value in a sorted collection by repeatedly halving the search interval, needing about log2(n) comparisons for n elements.