www

导航

2019年2月16日 #

旋转数组的最小数字

摘要: private int minNumberInRotateArray(int [] array) { if (array == null || array.length == 0) { throw new RuntimeException("input is invalid"); } int index1 = 0;... 阅读全文

posted @ 2019-02-16 18:22 www_practice 阅读(127) 评论(0) 推荐(0) 编辑

BinarySearch(Java)

摘要: 1 private int binarySearch(int[] input, int target) { 2 if (input == null) { 3 return -1; 4 } 5 6 int index1 = 0; 7 int index2 = input.length-1... 阅读全文

posted @ 2019-02-16 17:44 www_practice 阅读(144) 评论(0) 推荐(0) 编辑

QuickSort(Java)

摘要: 1 private void quickSort(int[] input, int start, int end) { 2 if (start >= end) return; 3 4 int index = partition(input, start, end); 5 6 if (index > start) { 7 ... 阅读全文

posted @ 2019-02-16 17:32 www_practice 阅读(162) 评论(0) 推荐(0) 编辑