Tag
BinarySearch
Language
- Nov 3, 2024
Shrinking the Search Space with Binary Search
Binary search is an efficient searching technique based on the divide-and-conquer principle. By repeatedly narrowing the search space, it guarantees a worst-case time complexity of O(log n). It is well-suited for sorted data, monotonic arrays, and optimization problems where the goal is to find the best value. Common use cases include exact matching, boundary and insertion point searches, finding the closest element, and performing binary search on the answer space.
#BinarySearch - Nov 5, 2025
[Leetcode 34] 在排序数组中查找元素的第一个和最后一个位置
找出给定目标值在排序数组中的开始位置和结束位置。
#二分搜索#BinarySearch