摘要:
我惯用的dfs模板直接拿来套 class Solution { public: vector<string> Permutation(string str) { if(str.empty()){return{};} int n=str.size(); vector<string> res; vect 阅读全文
摘要:
中序递归,一个pre节点记录前一个节点 /* struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) { } 阅读全文
摘要:
时间O(N),空间O(N) /* struct RandomListNode { int label; struct RandomListNode *next, *random; RandomListNode(int x) : label(x), next(NULL), random(NULL) { 阅读全文