摘要:
int Mycmp(const void* a,const void* b) { return *(int*)a % 2 - *(int*)b % 2; } int* sortArrayByParity(int* A, int ASize, int* returnSize){ qsort(A,ASi 阅读全文
posted @ 2020-09-05 15:14
温暖了寂寞
阅读(116)
评论(0)
推荐(0)
摘要:
int* sortArrayByParityII(int* A, int ASize, int* returnSize){ int* arr = (int*)calloc(ASize,sizeof(int)); int evenindex = 0; int oddindex = 1; for (in 阅读全文
posted @ 2020-09-05 15:07
温暖了寂寞
阅读(110)
评论(0)
推荐(0)
摘要:
int Fun(int x){ int res=0; while (x) res+=x&1,x>>=1; return res; } int Mycmp(const void* a,const void* b){ return (Fun(*(int*)a) - Fun(*(int*)b))? Fun 阅读全文
posted @ 2020-09-05 14:34
温暖了寂寞
阅读(161)
评论(0)
推荐(0)
摘要:
int Mycmp(const void* a,const void* b){ return *(int*)a - *(int*)b; } void merge(int* A, int ASize, int m, int* B, int BSize, int n){ for (int i=m; i< 阅读全文
posted @ 2020-09-05 13:50
温暖了寂寞
阅读(126)
评论(0)
推荐(0)
摘要:
int findString(char** words, int wordsSize, char* s){ for (int i=0; i<wordsSize; i++)if (!strcmp(words[i],s)) return i; return -1; } 阅读全文
posted @ 2020-09-05 13:15
温暖了寂寞
阅读(141)
评论(0)
推荐(0)
摘要:
int balancedStringSplit(char * s){ int count=0,num = 0; for (int i=0; i<=strlen(s); i++) { (s[i] == 'R') ? count++:count--; if (!count) num++; } retur 阅读全文
posted @ 2020-09-05 12:07
温暖了寂寞
阅读(90)
评论(0)
推荐(0)
摘要:
int Mycmp(const void* a,const void* b) { return *(int*)a - *(int*)b; } int* sortedSquares(int* A, int ASize, int* returnSize){ for (int i=0; i<ASize; 阅读全文
posted @ 2020-09-05 10:40
温暖了寂寞
阅读(122)
评论(0)
推荐(0)

浙公网安备 33010602011771号