上一页 1 ··· 4 5 6 7 8 9 10 下一页
摘要: address /** * Note: The returned array must be malloced, assume caller calls free(). */ int* exchange(int* nums, int numsSize, int* returnSize){ int i 阅读全文
posted @ 2021-01-23 05:09 RougeBW 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 可以用二分优化 address int missingNumber(int* nums, int numsSize){ int guiwei(int shu){ int a= nums[shu]; nums[shu] = shu; if((a>=0)&&(a<numsSize)) guiwei(a) 阅读全文
posted @ 2021-01-22 20:37 RougeBW 阅读(29) 评论(0) 推荐(0) 编辑
摘要: address /** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ struct ListNode *getIntersectionNode( 阅读全文
posted @ 2021-01-22 20:18 RougeBW 阅读(33) 评论(0) 推荐(0) 编辑
摘要: address /** * Definition for a binary tree node. * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */ // 带着深度递归 i 阅读全文
posted @ 2021-01-22 20:08 RougeBW 阅读(29) 评论(0) 推荐(0) 编辑
摘要: address 需要优化 // 时间复杂度n^2 char firstUniqChar(char* s){ int getlen(char* s){ int i = 0; while(s[i] != '\0'){ i++; } return i; } int len = getlen(s); if( 阅读全文
posted @ 2021-01-22 19:53 RougeBW 阅读(30) 评论(0) 推荐(0) 编辑
摘要: address int fib(int n){ if(n == 0) return 0; if(n == 1) return 1; int a[n+1]; a[0] = 0; a[1] = 1; for(int i = 2; i<=n; i++) a[i] = (a[i-1] + a[i-2])%1 阅读全文
posted @ 2021-01-21 20:25 RougeBW 阅读(41) 评论(0) 推荐(0) 编辑
摘要: 同主站154题 address int minArray(int* numbers, int numbersSize){ if(numbersSize == 1) return numbers[0]; int i = 0; while((i<numbersSize-1) && (numbers[i] 阅读全文
posted @ 2021-01-21 20:20 RougeBW 阅读(31) 评论(0) 推荐(0) 编辑
摘要: address /** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ /** * Note: The returned array must b 阅读全文
posted @ 2021-01-21 20:18 RougeBW 阅读(36) 评论(0) 推荐(0) 编辑
摘要: 同主战的70 address int numWays(int n){ if(n==0) return 1; int A[n+1]; A[0] = 1; A[1] = 1; for (int i = 2;i<= n;i++) A[i] = (A[i-1] + A[i-2])%1000000007; r 阅读全文
posted @ 2021-01-21 18:44 RougeBW 阅读(35) 评论(0) 推荐(0) 编辑
摘要: address /** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ struct ListNode* getKthFromEnd(struct 阅读全文
posted @ 2021-01-21 07:01 RougeBW 阅读(28) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 下一页