Tag: binary_search
Koko Eating Bananas
Date: 3/4/2024Tags:algorithmsleetcodebinary_searchThe journal entry on "Koko Eating Bananas" discusses using binary search to find the minimum speed at which Koko can eat all bananas within a given time frame, maintaining invariants related to pointers and returning the valid speed through a coded function minEatingSpeed.
Search a 2D Matrix
Date: 2/24/2024Tags:algorithmsleetcodebinary_searchThe journal entry discussed two attempts at solving the "Search a 2D Matrix" problem using binary search by first identifying the correct row based on the target value's range within the rows and then conducting a binary search within that row to find the target value, with the algorithm ultimately efficiently locating the target value in the matrix; the related code includes two functions for these two stages of binary search.
Insert Interval
Date: 2/16/2024Tags:algorithmsleetcodeintervalbinary_searchThe journal entry titled "Insert Interval" describes a solution that uses binary search to find the index of the interval preceding a new interval, adds intervals from the beginning to that point to a result array, merges overlapping intervals, and pushes the new interval to the result array; it includes coding implementation.