摘要: 可以用二分优化 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) 编辑