2016年4月22日

二叉树中和为某一值得所有路径

摘要: /** * */ package jianzhioffer; import java.util.HashMap; import java.util.Map; import java.util.Stack; /** * @Description * @author liutao * @data 2016年4月22日 */ public class a25_findPathI... 阅读全文

posted @ 2016-04-22 19:57 todayjust 阅读(139) 评论(0) 推荐(0) 编辑

剑指offer24:判断一个二叉树的后序遍历序列是否为二叉搜索树的后序遍历序列

摘要: public static boolean isBSTSequence(int[] s,int l, int r) { if (s == null || r root) break; } int j = i; for (; j 0) left = isBSTSequence... 阅读全文

posted @ 2016-04-22 16:34 todayjust 阅读(144) 评论(0) 推荐(0) 编辑

剑指offer12 打印从1到N位的所有数字,处理大整数情况

摘要: /** * */ package jianzhioffer; /** * @Description 输入n位数,输出0-N的所有数 * @author liutao * @data 2016年4月22日 */ public class a12_print1ToMaxOfNDigits { public static void Print1ToN(int n){ ... 阅读全文

posted @ 2016-04-22 15:56 todayjust 阅读(273) 评论(0) 推荐(0) 编辑

剑指OFFER18 判断一个二叉树的子树

摘要: public class a18_IsSubTree { public static boolean hasSubTree(TreeNode treeRoot1, TreeNode treeRoot2) { boolean result = false; if (treeRoot1 != null && treeRoot2 != null) { ... 阅读全文

posted @ 2016-04-22 15:54 todayjust 阅读(186) 评论(0) 推荐(0) 编辑

给定入栈序列,判断一个串是否为出栈序列

摘要: 剑指offer22:给定入栈序列,判断一个串是否为出栈序列 public static boolean isOutStackSequence(int[] Spush, int[] Spop) { if (Spush.length s = new Stack(); int i=0,j=0; for (; i < len; i++) { ... 阅读全文

posted @ 2016-04-22 15:51 todayjust 阅读(283) 评论(0) 推荐(0) 编辑

导航