dsa1 min read
Find First and Last Position — Dual Left/Right Boundary
Find the starting and ending positions of a target in a sorted array using two separate binary searches.
Read →
1575 articles
Find the starting and ending positions of a target in a sorted array using two separate binary searches.
Search in a rotated sorted array by identifying which half is sorted and narrowing accordingly.
Find the minimum element in a rotated sorted array by comparing mid with right boundary to locate the rotation point.
Search a row-column sorted 2D matrix in O(log(m*n)) by treating it as a virtual 1D sorted array.
Find the minimum eating speed for Koko to finish all bananas in h hours using binary search on the answer space.