摘要:
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.思路:递归的思路。思路与重建二叉树类似。时间复杂度O(n), 空间复杂度O(logN) 1 /** 2 ... 阅读全文
摘要:
Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only n... 阅读全文