摘要:
//C语言 typedef struct { int front; int back; int maxFront; int maxBack; int max[10001]; int queue[10001]; } MaxQueue; MaxQueue* maxQueueCreate() { MaxQ 阅读全文
摘要:
bool isOneBitCharacter(int* bits, int bitsSize){ for(int i=0; i<bitsSize; i++){ if(i==bitsSize-1 && bits[i]==0) return true; if(bits[i]==1) i++; } ret 阅读全文
摘要:
#define MAXLEN 10001 char * addBinary(char * a, char * b){ char* arr=(char*)calloc(MAXLEN+1,sizeof(char)); int right1=strlen(a)-1, right2=strlen(b)-1, 阅读全文
摘要:
int addDigits(int num){ while(num>=10){ int temp=0; while(num){ temp += num%10; num/=10; } num=temp; } return num; } 阅读全文
摘要:
#define MAXLEN 6000 char * addStrings(char * num1, char * num2){ char* arr=(char*)calloc(MAXLEN+1,sizeof(char)); int right1=strlen(num1)-1, right2=str 阅读全文
摘要:
int add(int a, int b){ long long temp; while(a){ temp = a&b; b = a^b; a=temp*2; } return b; } 阅读全文
摘要:
#define MAXLEN 10001 int* addToArrayForm(int* A, int ASize, int K, int* returnSize){ int* arr=(int*)calloc(sizeof(int),MAXLEN); int i, pst=MAXLEN, fla 阅读全文
摘要:
typedef struct { int front[2]; int rear[2]; int* arr[2][20001]; int noAnimal[2]; } AnimalShelf; AnimalShelf* animalShelfCreate() { AnimalShelf* obj=(A 阅读全文
摘要:
int arrangeCoins(int n){ int i; for(i=1; n>=0; i++) n-=i; return i-2; } 阅读全文
摘要:
/*C语言*/ int cmp(const void* a,const void* b){ return *(int*)a>*(int*)b; } int arrayPairSum(int* nums, int numsSize){ int sum=0, i; qsort(nums,numsSize 阅读全文