摘要: 方法一: 由于是有序的平衡二叉树,因此是中序。根据dfs中序迭代求得递增排序后,再反转就可求得结果。 class Solution { public: vector<int> tmp; int kthLargest(TreeNode* root, int k) { // if(root != NUL 阅读全文
posted @ 2023-08-19 11:39 luxiayuai 阅读(18) 评论(0) 推荐(0)