Search for a Range
摘要:
Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the order ofO(logn).If the target is not found in the array, return[-1, -1].For example,Given[5, 7, 7, 8, 8, 10]and target value 8,return[3, 4].思路二分查找的变形 阅读全文
posted @ 2013-10-25 19:13 waruzhi 阅读(246) 评论(0) 推荐(0) 编辑