摘要: 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... 阅读全文
posted @ 2015-05-21 21:26 TonyLuis 阅读(178) 评论(0) 推荐(0)
摘要: Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. For example,Given:s1 = "aabcc",s2 = "dbbca",When s3 = "aadbbcbcac", retu... 阅读全文
posted @ 2015-05-21 21:18 TonyLuis 阅读(173) 评论(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 BST'... 阅读全文
posted @ 2015-05-21 17:35 TonyLuis 阅读(162) 评论(0) 推荐(0)
摘要: 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 all... 阅读全文
posted @ 2015-05-21 17:23 TonyLuis 阅读(189) 评论(0) 推荐(0)