摘要:
1 public class BinarySearch{ 2 public int BinarySearch(int[] array, int target){ 3 if(array == null || array.length = 0){ 4 return -1; 5 } 6 while (left ... 阅读全文
posted @ 2018-04-03 08:40
小粉要努力呀
阅读(49)
评论(0)
推荐(0)
摘要:
1 public class Power{ 2 public long power(int a, int b){ 3 if (b == 0){ 4 return 1; 5 } 6 if (a == 0) { 7 return 0; 8 } 9 10 ... 阅读全文
posted @ 2018-04-03 08:26
小粉要努力呀
阅读(106)
评论(0)
推荐(0)
摘要:
1 public class Fibonacci{ 2 3 4 public long fibonacci(int k) { 5 if (int k <= 0) { 6 return 0; 7 } 8 long[] array = new long[k + 1]; 9 array[1]... 阅读全文
posted @ 2018-04-03 08:19
小粉要努力呀
阅读(71)
评论(0)
推荐(0)
摘要:
1 public class QuickSort { 2 Random rand = new Random(); 3 public int[] quickSort(int[] array) { 4 if (array == null || array.length = 0) { 5 return array; 6 ... 阅读全文
posted @ 2018-04-03 07:57
小粉要努力呀
阅读(79)
评论(0)
推荐(0)
摘要:
Given an array of integers, sort the elements in the array in ascending order. The selection sort algorithm should be used to solve this problem. Exam 阅读全文
posted @ 2018-04-03 07:04
小粉要努力呀
阅读(97)
评论(0)
推荐(0)

浙公网安备 33010602011771号