📄️ 3.1 Algorithm Explanation
Binary search, also known as bisection or halving search (binary search, bisect), reduces the complexity of a search operation by dividing the search interval into two parts at each step and only proceeding with one part. For an array of length $O(n)$, the time complexity of binary search is $O(\log n)$.
📄️ 3.2 Calculating Square Root
69. Sqrt(x)
📄️ 3.3 Find Range
34. Find First and Last Position of Element in Sorted Array
📄️ 3.4 Find Maximum
162. Find Peak Element
📄️ 3.5 Search in Rotated Array
81. Search in Rotated Sorted Array II
📄️ 3.6 Exercises
Basic Difficulty