上一页 1 2 3 4 5 6 7 ··· 11 下一页

2019年4月8日

94. Binary Tree Inorder Traversal(非递归实现二叉树的中序遍历)

摘要: Given a binary tree, return the inorder traversal of its nodes' values. Example: Follow up: Recursive solution is trivial, could you do it iteratively 阅读全文

posted @ 2019-04-08 14:51 shaer 阅读(92) 评论(0) 推荐(0) 编辑

144. Binary Tree Preorder Traversal(非递归实现二叉树的前序遍历)

摘要: Given a binary tree, return the preorder traversal of its nodes' values. Example: Follow up: Recursive solution is trivial, could you do it iterativel 阅读全文

posted @ 2019-04-08 14:00 shaer 阅读(132) 评论(0) 推荐(0) 编辑

2019年3月25日

337. House Robber III(间隔遍历)

摘要: 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 @ 2019-03-25 17:18 shaer 阅读(90) 评论(0) 推荐(0) 编辑

687. Longest Univalue Path(相同节点值的最大路径长度)

摘要: 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 @ 2019-03-25 17:05 shaer 阅读(162) 评论(0) 推荐(0) 编辑

2019年3月24日

404. Sum of Left Leaves(统计左叶子节点的和)

摘要: Find the sum of all left leaves in a given binary tree. Example: 阅读全文

posted @ 2019-03-24 10:32 shaer 阅读(61) 评论(0) 推荐(0) 编辑

2019年3月22日

ArrayList源码

摘要: 1、实现了 RandomAccess 接口,因此支持随机访问。这是理所当然的,因为 ArrayList 是基于数组实现的。 public class ArrayList<E> extends AbstractList<E> implements List<E>, RandomAccess, Clon 阅读全文

posted @ 2019-03-22 16:38 shaer 阅读(97) 评论(0) 推荐(0) 编辑

2019年3月21日

101. Symmetric Tree(树的对称)

摘要: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is symmet 阅读全文

posted @ 2019-03-21 20:26 shaer 阅读(110) 评论(0) 推荐(0) 编辑

572. Subtree of Another Tree(子树)

摘要: Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a 阅读全文

posted @ 2019-03-21 20:06 shaer 阅读(104) 评论(0) 推荐(0) 编辑

437. Path Sum III(统计路径和等于一个数的路径数量)

摘要: 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 @ 2019-03-21 12:01 shaer 阅读(158) 评论(0) 推荐(0) 编辑

112. Path Sum(判断路径和是否等于一个数)

摘要: 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 @ 2019-03-21 11:35 shaer 阅读(124) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 ··· 11 下一页

导航