摘要: 1 public class Main{ 2 public static int binarySearch(int a[],int x,int n) { 3 int left=0; 4 int right=n-1; 5 while(left<=right) { 6 int middle=(left+rig... 阅读全文
posted @ 2019-01-01 18:46 f-- 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 1 public class Main{ 2 public static int q(int n,int m) { 3 if(m<1||n<1) { 4 return 0; 5 } 6 if(m==1||n==1) { 7 return 1; 8 } 9 ... 阅读全文
posted @ 2019-01-01 18:21 f-- 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 1 public class Main{ 2 public static int list[]= {1,2,3}; 3 public static void swap(int list[],int k,int m){ 4 int temp=list[k]; 5 list[k]=list[m]; 6 list[m]=tem... 阅读全文
posted @ 2019-01-01 14:59 f-- 阅读(203) 评论(0) 推荐(0) 编辑