摘要: char *convertToTitle(int n) { char num[20];int k = 0; while(n){ num[k++] = (n-1)%26 + 'A'; n = (n-1)/26; } for(int i = 0;i <... 阅读全文
posted @ 2015-03-04 21:14 SprayT 阅读(99) 评论(0) 推荐(0)
摘要: 方法一:排序取中间的那个数就行O(n*log(n));int cmp ( const void *a , const void *b){ return *(int *)a - *(int *)b;}int majorityElement(int num[], int n) { q... 阅读全文
posted @ 2015-03-04 19:31 SprayT 阅读(101) 评论(0) 推荐(0)