摘要: Given a binary tree, find the length of the longest consecutive sequence path. The path refers to any sequence of nodes from some starting node to any 阅读全文
posted @ 2017-10-13 05:46 jasminemzy 阅读(216) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest l 阅读全文
posted @ 2017-10-13 04:51 jasminemzy 阅读(87) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest l 阅读全文
posted @ 2017-10-13 02:49 jasminemzy 阅读(98) 评论(0) 推荐(0) 编辑
摘要: Flatten a binary tree to a fake "linked list" in pre-order traversal. Here we use the right pointer in TreeNode as the nextpointer in ListNode. Notice 阅读全文
posted @ 2017-10-13 02:28 jasminemzy 阅读(148) 评论(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 only 阅读全文
posted @ 2017-10-12 14:43 jasminemzy 阅读(162) 评论(0) 推荐(0) 编辑
摘要: Given the root and two nodes in a Binary Tree. Find the lowest common ancestor(LCA) of the two nodes.The lowest common ancestor is the node with large 阅读全文
posted @ 2017-10-12 12:51 jasminemzy 阅读(180) 评论(0) 推荐(0) 编辑
摘要: Given the root and two nodes in a Binary Tree. Find the lowest common ancestor(LCA) of the two nodes. The lowest common ancestor is the node with larg 阅读全文
posted @ 2017-10-12 05:44 jasminemzy 阅读(293) 评论(0) 推荐(0) 编辑
摘要: Given the root and two nodes in a Binary Tree. Find the lowest common ancestor(LCA) of the two nodes. The lowest common ancestor is the node with larg 阅读全文
posted @ 2017-10-11 12:56 jasminemzy 阅读(166) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which the dept 阅读全文
posted @ 2017-10-09 03:22 jasminemzy 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return all root-to-leaf paths. Example Given the following binary tree: 1 / \ 2 3 \ 5 All root-to-leaf paths are: [ "1->2->5", "1 阅读全文
posted @ 2017-10-08 14:34 jasminemzy 阅读(151) 评论(0) 推荐(0) 编辑