摘要:
Given an array where elements are sorted in ascending order, convert it to a height balanced BST. 本质就是寻找分割点,分割点作为当前节点,然后递归左区间和右区间。 分割点就是数组中间位置的节点。 那么为 阅读全文
摘要:
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia 阅读全文