[CareerCup] 4.1 Balanced Binary Tree 平衡二叉树

简介:

4.1 Implement a function to check if a binary tree is balanced. For the purposes of this question, a balanced tree is defined to be a tree such that the heights of the two subtrees of any node never differ by more than one.

LeetCode上的原题,请参见我之前的博客Balanced Binary Tree 平衡二叉树

本文转自博客园Grandyang的博客,原文链接:平衡二叉树[CareerCup] 4.1 Balanced Binary Tree ,如需转载请自行联系原博主。

相关文章
|
5月前
|
数据库 C++
二叉搜索树(Binary Search Tree,BST)
二叉搜索树(Binary Search Tree,BST)
LeetCode 110. Balanced Binary Tree
给定一颗二叉树,判断此树是不是平衡二叉树. 平衡二叉树的条件是:当前节点的左右子树高度差不超过1,且左右子树都是平衡二叉树.
64 0
LeetCode 110. Balanced Binary Tree
LeetCode 104. 二叉树的最大深度 Maximum Depth of Binary Tree
LeetCode 104. 二叉树的最大深度 Maximum Depth of Binary Tree