上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 48 下一页
摘要: 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-23 11:05 daniel456 阅读(84) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example:Given binary tree [3 阅读全文
posted @ 2017-10-23 11:02 daniel456 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 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 @ 2017-10-23 11:00 daniel456 阅读(91) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. For example:Given the below binary tree and sum 阅读全文
posted @ 2017-10-23 10:53 daniel456 阅读(100) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, flatten it to a linked list in-place. For example,Given The flattened tree should look like: 方法二: 阅读全文
posted @ 2017-10-23 10:46 daniel456 阅读(89) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL 阅读全文
posted @ 2017-10-23 10:34 daniel456 阅读(120) 评论(0) 推荐(0) 编辑
摘要: Follow up for problem "Populating Next Right Pointers in Each Node". What if the given tree could be any binary tree? Would your previous solution sti 阅读全文
posted @ 2017-10-23 10:26 daniel456 阅读(96) 评论(0) 推荐(0) 编辑
摘要: You need to find the largest value in each row of a binary tree. Example: 方法二: 阅读全文
posted @ 2017-10-23 08:14 daniel456 阅读(210) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the preorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, return [1,2,3]. Note: Recursive solu 阅读全文
posted @ 2017-10-23 08:07 daniel456 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST. Calling next() will return the n 阅读全文
posted @ 2017-10-23 08:00 daniel456 阅读(104) 评论(0) 推荐(0) 编辑
上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 48 下一页