Binary Search 二分查找总结

Binary Search基本的复杂度为O(logn)。若是提示须要对O(n)的算法进行优化,很是可能就是二分,另外二分通常出如今排序数组或者变形后的排序数组(rotated array)当中。二分主要有两种,binary search on index(index上的二分)和binary search on result(结果上的二分)。index上的二分主要有html   result上的二分
相关文章
相关标签/搜索