上一页 1 2 3 4 5 6 7 8 9 ··· 17 下一页
摘要: Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and 阅读全文
posted @ 2016-11-04 23:04 wangxiaobao1114 阅读(167) 评论(0) 推荐(0) 编辑
摘要: Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identical a 阅读全文
posted @ 2016-11-04 23:01 wangxiaobao1114 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. (Hard) Below is one possible repre 阅读全文
posted @ 2016-11-01 21:27 wangxiaobao1114 阅读(164) 评论(0) 推荐(0) 编辑
摘要: Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. (Hard) For example,Given:s1 = "aabcc",s2 = "dbbca", When s3 = "aadbbcbca 阅读全文
posted @ 2016-10-31 22:34 wangxiaobao1114 阅读(159) 评论(0) 推荐(0) 编辑
摘要: Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. (Hard) Note:A solution using O(n) 阅读全文
posted @ 2016-10-28 21:40 wangxiaobao1114 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1...n. (Medium) For example,Given n = 3, your progr 阅读全文
posted @ 2016-10-27 21:04 wangxiaobao1114 阅读(182) 评论(0) 推荐(0) 编辑
摘要: Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area. (Hard) For example, given the fo 阅读全文
posted @ 2016-10-27 20:59 wangxiaobao1114 阅读(257) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, determine if it is a valid binary search tree (BST). (Medium) Assume a BST is defined as follows: The left subtree of a node cont 阅读全文
posted @ 2016-10-26 22:48 wangxiaobao1114 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 题目: Given n, how many structurally unique BST's (binary search trees) that store values 1...n? (Medium) For example,Given n = 3, there are a total of 阅读全文
posted @ 2016-10-25 22:03 wangxiaobao1114 阅读(139) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the inorder traversal of its nodes' values. (Medium) For example:Given binary tree [1,null,2,3], return [1,3,2]. Note: Rec 阅读全文
posted @ 2016-10-25 22:00 wangxiaobao1114 阅读(619) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 17 下一页