摘要: 题目: 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 @ 2018-06-03 15:59 板弓子 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 题目: Given n, how many structurally unique BST's (binary search trees) that store values 1 ... n? Example: 提交后显示运行时间超时。原来是代码中有太多重复迭代,如同求解斐波那契数列时的直接迭代解法 阅读全文
posted @ 2018-06-03 11:57 板弓子 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). Example: Note: If the 阅读全文
posted @ 2018-06-03 10:42 板弓子 阅读(109) 评论(0) 推荐(0) 编辑