摘要: public class JdbcTest { public static void main(String[] args){ int[] arr = {1,2,3,4,5,6,7,8}; int result = searchHalf_2(arr, 5); System.out.println(result); } /** * 二分查找法(要求待查表为有序表) * @param arr 数组 * @param key 要查找的数 * @return 返回查找的数在数组中的索引位置 */ public static int searchHalf_2(int[] arr, int... 阅读全文
posted @ 2014-02-25 08:27 lxricecream 阅读(193) 评论(0) 推荐(0)