重练算法(代码随想录版) day15 - 二叉树part3

今日刷题量:4
当前刷题总量:77
Easy: 47
Mid: 28
Hard: 2

Day15
基础理论
1.平衡二叉树定义为:一个二叉树每个节点 的左右两个子树的高度差的绝对值不超过1
2.求深度可以从上到下去查--前序遍历(中左右)
3.求高度只能从下到上去查--后序遍历(左右中)
4.回溯和递归是一一对应的,有一个递归,就要有一个回溯

练习题目
110.平衡二叉树(easy):https://leetcode.cn/problems/balanced-binary-tree/
257. 二叉树的所有路径 (easy):https://leetcode.cn/problems/binary-tree-paths/
404.左叶子之和(easy):https://leetcode.cn/problems/sum-of-left-leaves/
222.完全二叉树的节点个数(easy):https://leetcode.cn/problems/count-complete-tree-nodes/description/

posted @ 2025-11-19 20:35  GengarF  阅读(2)  评论(0)    收藏  举报