上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 63 下一页
摘要: struct TreeNode** buildTree(int start, int end, int* returnSize) { if (start > end) { (*returnSize) = 1; struct TreeNode** ret = malloc(sizeof(struct 阅读全文
posted @ 2020-12-15 12:18 温暖了寂寞 阅读(51) 评论(0) 推荐(0) 编辑
摘要: int numTrees(int n){ int hash[50]={0} ,i, j; hash[0]=1; for(i=1; i<=n; i++) for(j=1; j<=i; j++) hash[i] += hash[j-1]*hash[i-j]; return hash[n]; } 阅读全文
posted @ 2020-12-15 12:16 温暖了寂寞 阅读(56) 评论(0) 推荐(0) 编辑
摘要: int* inorderTraversal(struct TreeNode* root, int* returnSize) { *returnSize = 0; int* res = malloc(sizeof(int) * 501); struct TreeNode** stk = malloc( 阅读全文
posted @ 2020-12-14 15:25 温暖了寂寞 阅读(91) 评论(0) 推荐(0) 编辑
摘要: void recursion(char * s,int slen,char** arr,int* returnSize,char* temp,int tlen,int cnt,int start,int len){ if(cnt==4){ if(tlen==len+4){ arr[(*returnS 阅读全文
posted @ 2020-12-14 12:13 温暖了寂寞 阅读(89) 评论(0) 推荐(0) 编辑
摘要: struct ListNode* reverseBetween(struct ListNode* head, int m, int n){ if (m == n) return head; struct ListNode* root = (struct ListNode*)calloc(sizeof 阅读全文
posted @ 2020-12-14 00:57 温暖了寂寞 阅读(67) 评论(0) 推荐(0) 编辑
摘要: int numDecodings(char * s){ int f0 = 0, f1=1, f2, i, len = strlen(s); for (i = len - 1; i >= 0; i--){ if (s[i] == '0') f2 = 0; else if (s[i] == '1' || 阅读全文
posted @ 2020-12-13 23:07 温暖了寂寞 阅读(71) 评论(0) 推荐(0) 编辑
摘要: int* grayCode(int n, int* returnSize){ int cnt=pow(2,n); *returnSize=cnt; int* arr=(int*)calloc(cnt,sizeof(int)); int i, j, temp; int hash[10000]={0}; 阅读全文
posted @ 2020-12-13 20:22 温暖了寂寞 阅读(66) 评论(0) 推荐(0) 编辑
摘要: struct ListNode* partition(struct ListNode* head, int x){ struct ListNode* left=(struct ListNode*)calloc(sizeof(struct ListNode),1); struct ListNode* 阅读全文
posted @ 2020-12-13 17:45 温暖了寂寞 阅读(83) 评论(0) 推荐(0) 编辑
摘要: struct ListNode* deleteDuplicates(struct ListNode* head){ int cnt=0; struct ListNode* root=(struct ListNode*)calloc(sizeof(struct ListNode),1); struct 阅读全文
posted @ 2020-12-13 17:20 温暖了寂寞 阅读(56) 评论(0) 推荐(0) 编辑
摘要: bool search(int* nums, int numsSize, int target){ if(numsSize==0) return false; int i; if(nums[0]==target) return true; else if(nums[0]>target){ for(i 阅读全文
posted @ 2020-12-13 12:11 温暖了寂寞 阅读(65) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 63 下一页