Binary Search Problem Starategy
in Algorithms
- Binary Search is a search algorithm which can greatly save the time by trim the search space by half each time.
Typical explicit binary search problem will be ‘’
Template
int left=0; int right =0; while(){ }
Related problems
•Leetcode 11) Container With Most Water •Leetcode 33) Search in Rotated Sorted Array •Leetcode 34) Find First and Last Position of Element in Sorted Array •Leetcode 69) Sqrt(x) •Leetcode 153) Final Minimum in Rotated Sorted Array •Leetcode 154) Find Minimum in Rotated Sorted Array2 •Leetcode 162) Find Peak Element •Leetcode 270) Closest Binary Search Tree Value •Leetcode 278) First Bad Version •Leetcode 287) Find the Duplicate Number •Leetcode 367) Valid Perfect Square •Leetcode 374) Guess Number Higher or Lower •Leetcode 658) Find K Closest Elements •Leetcode 702) Search in a Sorted Array of Unkown Size •Leetcode 704) Binary Search •Leetcode BS 정리