摘要:
题目: The code base version is an integer start from 1 to n. One day, someone committed a bad version in the code case, so it caused this version and th 阅读全文
摘要:
题目: Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted i 阅读全文
摘要:
模板:(通用模板,推荐) 给定一个排序的整数数组(升序)和一个要查找的整数target,用O(logn)的时间查找到target第一次出现的下标(从0开始),如果target不存在于数组中,返回-1。 若将条件改为查找target最后一次出现的下标(从0开始),那么程序将发生改变,循环中如果 arr 阅读全文