摘要: 题目: Given n, generate all structurally unique BST's (binary search trees) that store values 1...n. For example,Given n = 3, your program should return 阅读全文
posted @ 2016-06-03 22:25 沧浪少年 阅读(908) 评论(0) 推荐(0) 编辑
摘要: 题目: Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For example,Given n = 3, there are a total of 5 unique 阅读全文
posted @ 2016-06-03 17:01 沧浪少年 阅读(575) 评论(0) 推荐(0) 编辑
摘要: 题目: 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 阅读全文
posted @ 2016-06-03 16:26 沧浪少年 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 题目要求: Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. 给出一棵二叉树,其中有两个结点交换了位置,要求找出这两个 阅读全文
posted @ 2016-06-03 15:52 沧浪少年 阅读(212) 评论(0) 推荐(0) 编辑