摘要:
本题比较重要的有两点: 1.一般认为有序的二叉搜索树,都是中序遍历。 2.中序遍历的递归顺序,得到的就是排好序的,就是链表的顺序,因此只需管遍历的过程中的链表指向即可。 class Solution { public: // pre将来指向尾节点,head指向头节点 Node *pre = null 阅读全文
posted @ 2023-08-18 23:47
luxiayuai
阅读(13)
评论(0)
推荐(0)
摘要:
dfs class Solution { public: vector<vector<int>> res; vector<int> tmp; void dfs(TreeNode *node, int target) { if(node == nullptr ) return; target -= n 阅读全文
posted @ 2023-08-18 19:18
luxiayuai
阅读(17)
评论(0)
推荐(0)

浙公网安备 33010602011771号