摘要:
Given an array where elements are sorted in ascending order, convert it to a height balanced BST. 解题思路: 1. 找到数组的中间节点将其置为根节点 2. 左边的即为左子树 3. 右边的即为右子树 4. 阅读全文
摘要:
Given a binary search tree, write a function kthSmallest to find thekth smallest element in it. Note: You may assume k is always valid, 1 ≤ k ≤ BST's 阅读全文