摘要: 遍历节点存入vector,之后排序,再取出相应的节点数据就可以了。 class Solution { public: int kthSmallest(TreeNode* root, int k) { vector<int>l; preorderTraversal(root, l); sort(l.b 阅读全文
posted @ 2021-04-23 18:58 章大佬 阅读(35) 评论(0) 推荐(0)