上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 37 下一页
摘要: Return any binary tree that matches the given preorder and postorder traversals. Values in the traversals pre and post are distinct positive integers. 阅读全文
posted @ 2019-01-01 05:20 fatttcat 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Given inorder and postorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. For example, 阅读全文
posted @ 2019-01-01 04:23 fatttcat 阅读(105) 评论(0) 推荐(0) 编辑
摘要: Given preorder and inorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. For example, 阅读全文
posted @ 2018-12-31 19:23 fatttcat 阅读(106) 评论(0) 推荐(0) 编辑
摘要: Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or 阅读全文
posted @ 2018-12-31 15:44 fatttcat 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, flatten it to a linked list in-place. For example, given the following tree: The flattened tree should look like: 每个节点的右节点都是preor 阅读全文
posted @ 2018-12-31 15:01 fatttcat 阅读(90) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. Example 阅读全文
posted @ 2018-12-31 12:06 fatttcat 阅读(106) 评论(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 @ 2018-12-31 11:39 fatttcat 阅读(101) 评论(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 @ 2018-12-31 09:37 fatttcat 阅读(138) 评论(0) 推荐(0) 编辑
摘要: A binary tree is univalued if every node in the tree has the same value. Return true if and only if the given tree is univalued. Example 1: Example 2: 阅读全文
posted @ 2018-12-31 08:08 fatttcat 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Given an n-ary tree, return the preorder traversal of its nodes' values. For example, given a 3-ary tree: Return its preorder traversal as: [1,3,5,6,2 阅读全文
posted @ 2018-12-31 08:01 fatttcat 阅读(115) 评论(0) 推荐(0) 编辑
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 37 下一页