
树
fxy流年无悔
不要留下太多遗憾
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
树-回溯-面试题34. 二叉树中和为某一值的路径
解题思路: /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ class So...原创 2020-04-19 10:57:22 · 130 阅读 · 0 评论 -
递归-树-面试题33. 二叉搜索树的后序遍历序列
递归: class Solution { public boolean verifyPostorder(int[] postorder) { return recu(postorder,0,postorder.length-1); } public boolean recu(int[] postorder,int i,int j){ ...原创 2020-04-18 09:53:37 · 202 阅读 · 0 评论 -
队列-树-BFS-面试题32 - II. 从上到下打印二叉树 II+面试题32 - I. 从上到下打印二叉树
/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ class Solution { p...原创 2020-04-17 22:16:42 · 162 阅读 · 0 评论 -
递归-树-面试题28. 对称的二叉树
/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ class Solution { ...原创 2020-04-17 10:17:45 · 130 阅读 · 0 评论