LeetCode-230. Kth Smallest Element in a BST(二叉搜索树中第K小的元素)
二叉搜索树中第K小的元素 Kth Smallest Element in a BST 解
方法一:递归中序遍历 一次中序遍历即可
/*** Definition for a binary tree node.* struct TreeNode {* int val;* struct TreeNode *left;* struct TreeNode *right;* };*///全局变量
int…
2026/9/19 1:26:07