上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 37 下一页
摘要: Given a tree, rearrange the tree in in-order so that the leftmost node in the tree is now the root of the tree, and every node has no left child and o 阅读全文
posted @ 2018-12-30 09:43 fatttcat 阅读(133) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty special binary tree consisting of nodes with the non-negative value, where each node in this tree has exactly two or zero sub-node. 阅读全文
posted @ 2018-12-30 09:14 fatttcat 阅读(203) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the length of the longest path where each node in the path has the same value. This path may or may not pass through the roo 阅读全文
posted @ 2018-12-30 08:28 fatttcat 阅读(116) 评论(0) 推荐(0) 编辑
摘要: Consider all the leaves of a binary tree. From left to right order, the values of those leaves form a leaf value sequence. For example, in the given t 阅读全文
posted @ 2018-12-30 07:32 fatttcat 阅读(153) 评论(0) 推荐(0) 编辑
摘要: Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in [L, R] (R >= L). You might 阅读全文
posted @ 2018-12-29 18:11 fatttcat 阅读(131) 评论(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 @ 2018-12-29 17:14 fatttcat 阅读(80) 评论(0) 推荐(0) 编辑
摘要: Given a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given target. E 阅读全文
posted @ 2018-12-29 16:47 fatttcat 阅读(104) 评论(0) 推荐(0) 编辑
摘要: Given a n-ary 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 le 阅读全文
posted @ 2018-12-29 15:28 fatttcat 阅读(78) 评论(0) 推荐(0) 编辑
摘要: Find the sum of all left leaves in a given binary tree. Example: M1: recursive time: O(n), space: O(height) M2: iterative 对于每一个节点,检查它的left child是不是lea 阅读全文
posted @ 2018-12-29 15:09 fatttcat 阅读(91) 评论(0) 推荐(0) 编辑
摘要: Given an n-ary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example, given a 3-ary tree: 阅读全文
posted @ 2018-12-29 05:42 fatttcat 阅读(155) 评论(0) 推荐(0) 编辑
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 37 下一页