摘要:
同主站239,但是239用这段代码会超时,需要优化 address /** * Note: The returned array must be malloced, assume caller calls free(). */ int* maxSlidingWindow(int* nums, int 阅读全文
摘要:
// 堆排,0号位置不存数 void head_adjust(int arr[], int k, int size_adjust){ arr[0] = arr[k]; int i; for (i=2*k ; i <= size_adjust ; i*=2){ if (i+1<= size_adjus 阅读全文
摘要:
address // 低效率算法 int* getLeastNumbers(int* arr, int arrSize, int k, int* returnSize){ ////排序算法 int partition(int *mm,int low, int high){ int pivot = m 阅读全文
摘要:
address int findLengthOfLCIS(int* nums, int numsSize){ if(numsSize == 0) return 0; int pstart = 1,answer = 1; for(int i =0; i<numsSize-1; i++){ if(num 阅读全文
摘要:
address // 先全部逆置,然后逆置后n位 char* reverseLeftWords(char* s, int n){ // 逆置函数 void inverse(int start, int end){ char temp; while(end>start){ temp = s[start 阅读全文