题目链接Leetcode_剑指Offer_55_II-平衡二叉树关键词{% label 深搜 green %}、{% label 二叉树 blue %}解析定义一个函数,用于获取二叉树的深度,并在获取的过程中,用一个变量,记录是否已经开始不平衡,如果是,就直接返回,减枝操作 最后返回用于标记的变量即可代码Author:CoderWddURL:https://www.wuinsights.top//article/9212f3ea1fc2Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!Relate PostsLeetcode 2923. 找到冠军 ILeetcode1026. 节点与其祖先之间的最大差值Leetcode 1702. 修改后的最大二进制字符串Leetcode 894. 所有可能的真二叉树Leetcode_64-最小路径和Leetcode_907-子数组的最小值之和Leetcode_剑指Offer_II_024-反转链表Leetcode_剑指Offer-34-二叉树中和为某一值的路径