上一页 1 ··· 27 28 29 30 31 32 33 34 35 ··· 49 下一页
摘要: You need to find the largest value in each row of a binary tree. Example: 方法二: 阅读全文
posted @ 2017-10-23 08:14 daniel456 阅读(217) 评论(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 阅读(132) 评论(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 阅读(112) 评论(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. For exa 阅读全文
posted @ 2017-10-23 07:56 daniel456 阅读(168) 评论(0) 推荐(0)
摘要: Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is always valid, 1 ≤ k ≤ BST's 阅读全文
posted @ 2017-10-22 21:58 daniel456 阅读(108) 评论(0) 推荐(0)
摘要: Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia: “The lowes 阅读全文
posted @ 2017-10-22 21:53 daniel456 阅读(125) 评论(0) 推荐(0)
摘要: The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Besides the root, each hou 阅读全文
posted @ 2017-10-22 21:41 daniel456 阅读(123) 评论(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 @ 2017-10-22 21:36 daniel456 阅读(194) 评论(0) 推荐(0)
摘要: Given the root of a tree, you are asked to find the most frequent subtree sum. The subtree sum of a node is defined as the sum of all the node values 阅读全文
posted @ 2017-10-22 21:28 daniel456 阅读(140) 评论(0) 推荐(0)
摘要: Given a binary tree, find the leftmost value in the last row of the tree. Example 1: Example 2: 阅读全文
posted @ 2017-10-22 21:25 daniel456 阅读(109) 评论(0) 推荐(0)
上一页 1 ··· 27 28 29 30 31 32 33 34 35 ··· 49 下一页