最近做笔试题有这么一个关于二分查找的例子. 给一个有序数组,和一个查找目标,用二分查找找出目标所在index,如果不存在,则返回-1-(其应该出现的位置),比如在0,6,9,15,18中找15,返回3:找10.则返回-4(-1-3) 实现如下: public class Sulution1 { public static void main(String[] args) { System.out.println(findBySep(2, new int[]{0,2,4,6,9})); } pub