上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 63 下一页
摘要: void addPath(int *vec, int *vecSize, struct TreeNode *node) { int count = 0; while (node != NULL) { ++count; vec[(*vecSize)++] = node->val; node = nod 阅读全文
posted @ 2020-12-23 18:52 温暖了寂寞 阅读(100) 评论(0) 推荐(0) 编辑
摘要: #define max(a,b) ((a)>(b))?(a):(b) #define min(a,b) ((a)<(b))?(a):(b) int maxProduct(int* nums, int numsSize){ int i, maxVal=nums[0], res=nums[0], min 阅读全文
posted @ 2020-12-23 14:35 温暖了寂寞 阅读(58) 评论(0) 推荐(0) 编辑
摘要: void recursion(struct TreeNode* root,int* returnSize,int* arr){ if (!root) return; arr[(*returnSize)++]=root->val; recursion(root->left,returnSize,arr 阅读全文
posted @ 2020-12-22 16:43 温暖了寂寞 阅读(58) 评论(0) 推荐(0) 编辑
摘要: void reorderList(struct ListNode* head){ struct ListNode* arr[40000]; struct ListNode* temp=(struct ListNode*)calloc(1,sizeof(struct ListNode)); int p 阅读全文
posted @ 2020-12-22 16:28 温暖了寂寞 阅读(80) 评论(0) 推荐(0) 编辑
摘要: struct ListNode* detectCycle(struct ListNode* head) { struct ListNode *slow = head, *fast = head; while (fast != NULL) { slow = slow->next; if (fast-> 阅读全文
posted @ 2020-12-22 15:17 温暖了寂寞 阅读(48) 评论(0) 推荐(0) 编辑
摘要: bool wordBreak(char * s, char ** wordDict, int wordDictSize){ int i=0, j, len=strlen(s); int stack[10000], left=0, right=0, val=0; stack[right++]=0; i 阅读全文
posted @ 2020-12-22 11:52 温暖了寂寞 阅读(101) 评论(0) 推荐(0) 编辑
摘要: /*遍历一边找出累加最小值, val是否小于0判断是否有存在的路线*/ int canCompleteCircuit(int* gas, int gasSize, int* cost, int costSize){ int i, j, val=0, minVal=2147483647; for (i 阅读全文
posted @ 2020-12-21 10:12 温暖了寂寞 阅读(51) 评论(0) 推荐(0) 编辑
摘要: void recursion(char* s,int* returnSize,int* col,int* oodhash,int* evenhash,int pst,int start,int len,char** temp,char*** arr){ if(start==len){ arr[(*r 阅读全文
posted @ 2020-12-20 21:29 温暖了寂寞 阅读(95) 评论(0) 推荐(0) 编辑
摘要: struct Trie { int ch[27]; int val; } trie[50001]; int size, nodeNum; int insert(char* s, int num) { int sSize = strlen(s), add = 0; for (int i = 0; i 阅读全文
posted @ 2020-12-20 10:08 温暖了寂寞 阅读(83) 评论(0) 推荐(0) 编辑
摘要: int sum(struct TreeNode* root, int tmp_sum) { if (root == NULL) return 0; if (root->left == root->right) { return tmp_sum * 10 + root->val; } return s 阅读全文
posted @ 2020-12-20 10:02 温暖了寂寞 阅读(84) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 63 下一页