上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 37 下一页
摘要: Given an n-ary tree, return the postorder traversal of its nodes' values. For example, given a 3-ary tree: Return its postorder traversal as: [5,6,3,2 阅读全文
posted @ 2018-12-31 07:51 fatttcat 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array. Example 1: Note: M1: BFS 注意!sum要用long,用int 阅读全文
posted @ 2018-12-31 07:31 fatttcat 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum of all 阅读全文
posted @ 2018-12-31 06:51 fatttcat 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Given a binary search tree (BST) with duplicates, find all the mode(s) (the most frequently occurred element) in the given BST. Assume a BST is define 阅读全文
posted @ 2018-12-30 17:51 fatttcat 阅读(133) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the tilt of the whole tree. The tilt of a tree node is defined as the absolute difference between the sum of all left subt 阅读全文
posted @ 2018-12-30 11:36 fatttcat 阅读(101) 评论(0) 推荐(0) 编辑
摘要: If the depth of a tree is smaller than 5, then this tree can be represented by a list of three-digits integers. For each integer in this list: Given a 阅读全文
posted @ 2018-12-30 11:23 fatttcat 阅读(144) 评论(0) 推荐(0) 编辑
摘要: You are given a binary tree in which each node contains an integer value. Find the number of paths that sum to a given value. The path does not need t 阅读全文
posted @ 2018-12-30 10:58 fatttcat 阅读(114) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. Note: A leaf is a node with no children. Exampl 阅读全文
posted @ 2018-12-30 10:41 fatttcat 阅读(85) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. N 阅读全文
posted @ 2018-12-30 10:07 fatttcat 阅读(77) 评论(0) 推荐(0) 编辑
摘要: You need to construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way. The null node needs to be rep 阅读全文
posted @ 2018-12-30 10:00 fatttcat 阅读(122) 评论(0) 推荐(0) 编辑
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 37 下一页