上一页 1 ··· 50 51 52 53 54 55 56 57 58 ··· 63 下一页
摘要: struct ListNode* reverseList(struct ListNode* head){ struct ListNode*p = NULL; struct ListNode*pre = NULL; while(head!=NULL) { p = head->next; head->n 阅读全文
posted @ 2020-08-21 23:28 温暖了寂寞 阅读(72) 评论(0) 推荐(0)
摘要: struct ListNode* mergeTwoLists(struct ListNode* l1, struct ListNode* l2){ if (l1 == NULL && l2 == NULL) return NULL; else if(l1 == NULL) return l2; el 阅读全文
posted @ 2020-08-21 20:24 温暖了寂寞 阅读(195) 评论(0) 推荐(0)
摘要: int* twoSum(int* nums, int numsSize, int target, int* returnSize){ int left = 0; int right = numsSize - 1; *returnSize = 2; int *ret = (int*)malloc(*r 阅读全文
posted @ 2020-08-21 17:35 温暖了寂寞 阅读(93) 评论(0) 推荐(0)
摘要: int** findContinuousSequence(int target, int* returnSize, int** returnColumnSizes){ int** arr = (int**)malloc(sizeof(int)*target); int* col = (int*)ma 阅读全文
posted @ 2020-08-21 16:56 温暖了寂寞 阅读(136) 评论(0) 推荐(0)
摘要: int lastRemaining(int n, int m){ int i = 0; int index = 0; //初始值 剩下一个人 胜利者坐标为0 for (i = 2; i < n + 1; i++) //递推到剩下n个人 胜利者的坐标 { index = (index + m) % i 阅读全文
posted @ 2020-08-21 13:47 温暖了寂寞 阅读(156) 评论(0) 推荐(0)
摘要: int search(int* nums, int numsSize, int target){ if (numsSize == 0) return 0; int count = 0; int i,j,index =0; for (i=0; i<numsSize; i++) { if (nums[i 阅读全文
posted @ 2020-08-21 10:00 温暖了寂寞 阅读(165) 评论(0) 推荐(0)
摘要: bool judge(struct TreeNode* left_node, struct TreeNode* right_node) { if (left_node == NULL && right_node == NULL) return true; else if (left_node == 阅读全文
posted @ 2020-08-21 00:18 温暖了寂寞 阅读(159) 评论(0) 推荐(0)
摘要: char* reverseLeftWords(char* s, int n){ if (n == 0) return s; int len = strlen(s); char* str = (char*)calloc(len+1,sizeof(char));//多一个字节后面放'\0'结束 n %= 阅读全文
posted @ 2020-08-20 18:59 温暖了寂寞 阅读(95) 评论(0) 推荐(0)
摘要: int Mycmp(const void* a,const void* b) { return *(int*)a - *(int*)b; } bool isStraight(int* nums, int numsSize){ qsort(nums,numsSize,sizeof(int),Mycmp 阅读全文
posted @ 2020-08-20 18:25 温暖了寂寞 阅读(170) 评论(0) 推荐(0)
摘要: int* printNumbers(int n, int* returnSize){ if (n == 0) return NULL; *returnSize = pow(10,n) - 1; int* arr = (int*)calloc(*returnSize,sizeof(int)); for 阅读全文
posted @ 2020-08-20 17:45 温暖了寂寞 阅读(134) 评论(0) 推荐(0)
上一页 1 ··· 50 51 52 53 54 55 56 57 58 ··· 63 下一页