Recite Binary Search (in english-pseudocode)
The idea 🗝️
The idea is to…
Search
Jan 28, 2024, 1 min read
1. Left and Right are two pointers which start at the first and last index of the array 2. While Left < Right, do the following: 3. Mid = (Left+Right)//2 4. Check if the Mid index is a match 5. Return Mid 6. If not, check whether the Mid number is higher than the desired number 7. Right = Mid - 1
The idea 🗝️
The idea is to…