![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
刷题总结
Little chicken leg
喜欢吃大鸡腿
展开
-
二叉树遍历
二叉树的前序中序后序前序:中,左,右中序:左(大小树都是找最左),中,右后序:左,中,右遍历二叉树的三种方法史上最全遍历二叉树详解详细通俗的思路分析,多解法递归解法前序遍历public static void preOrderRecur(TreeNode head) { if (head == null) { return; } // 调用一次postOrderRecur,就代表调用了一棵树 System.out.print(head.v转载 2020-08-31 09:50:44 · 76 阅读 · 0 评论 -
二叉树层序遍历
套模板!BFS 和 DFS 都可以解决迭代+递归 多图演示 102.二叉树的层次遍历迭代import java.util.*; class Solution { public List<List<Integer>> levelOrder(TreeNode root) { if(root==null) { return new ArrayList<List<Integer>>(); } List<List<Inte.转载 2020-08-31 12:15:43 · 103 阅读 · 0 评论