2014年3月19日

Single Number II

摘要: 转自:http://blog.csdn.net/kenden23/article/details/136252971 int singleNumber(int A[], int n) { 2 for(int i = 0; i 3<2不成立,然后呢,就木有然后了 1 int singleNumber(int A[], int n) { 2 if(A==NULL||n<=0) 3 return 0; 4 //if(n<=2) 5 //return A[0]; 6 sort... 阅读全文

posted @ 2014-03-19 17:30 crane_practice 阅读(140) 评论(0) 推荐(0) 编辑

Single Number

摘要: 1 int singleNumber(int A[], int n) {2 if(A==NULL||n<=0)//这是个好习惯,防止程序崩溃3 return 0;4 int i;5 int result=A[0];6 for(i=1;i<n;++i)7 result ^= A[i];8 return result;9 } 阅读全文

posted @ 2014-03-19 15:23 crane_practice 阅读(92) 评论(0) 推荐(0) 编辑

导航