第一个是普通二叉树,第二个是bstpublic class Solution { public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q) { if (root == null) { ...
分类:
其他好文 时间:
2015-12-05 08:26:38
阅读次数:
148
题目连接https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/Common Ancestor of a Binary TreeDescriptionGiven a binary tree, find the low...
分类:
其他好文 时间:
2015-12-04 22:59:08
阅读次数:
331
由于用到了第三方Html解析类库Hpple,在导入框架libxml2.2.dylib后,最到了XCode仍然找不到的情况,最后解决过程如下:1、项目-Targets中的Build Phases,找到Link Binary With Libraries,点击“+”,添加“libxml2.dylib”2...
分类:
移动开发 时间:
2015-12-04 18:37:13
阅读次数:
277
RPM是RedHat Package Manager(RedHat软件包管理工具)类似Windows里面的“添加/删除程序”rpm 执行安装包二进制包(Binary)以及源代码包(Source)两种。二进制包可以直接安装在计算机中,而源代码包将会由RPM自动编译、安装。源代码包经常以src.rpm作...
分类:
系统相关 时间:
2015-12-04 12:20:44
阅读次数:
213
两种解法,第一个是利用了前序遍历递增的特点public class Solution { long count = Long.MIN_VALUE; public boolean isValidBST(TreeNode root) { if (root == null) { ...
分类:
其他好文 时间:
2015-12-04 10:50:02
阅读次数:
143
1 public class Solution { 2 public List> zigzagLevelOrder(TreeNode root) { 3 List> result = new ArrayList>(); 4 if (root == null)...
分类:
其他好文 时间:
2015-12-04 10:37:41
阅读次数:
139
public class Solution { private int result = Integer.MIN_VALUE; public int maxPathSum(TreeNode root) { helper(root); return result...
分类:
其他好文 时间:
2015-12-04 07:55:16
阅读次数:
116
___/bin(binary二进制)常用Linux命令___/boot存放着启动Linux时使用的一些核心文件,包括一些链接文件以及镜像文件___/cdrom这个目录在你刚刚安装系统的时候是空的。你可以将光驱文件系统挂在这个目录下。例如:mount/dev/cdrom/cdrom___/sbin存放管理员使用的系统管理程序___/..
分类:
系统相关 时间:
2015-12-03 11:56:48
阅读次数:
248
题目:Given an array of numbers, verify whether it is the correct preorder traversal sequence of a binary search tree.You may assume each number in the s...
分类:
其他好文 时间:
2015-12-03 07:13:59
阅读次数:
138
题目:Given a binary tree, return all root-to-leaf paths.For example, given the following binary tree: 1 / \2 3 \ 5All root-to-leaf paths are:["...
分类:
其他好文 时间:
2015-12-03 07:12:59
阅读次数:
181