文章 2023-01-05 来自:开发者社区

LeetCode 110. Balanced Binary Tree

DescriptionGiven a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as:a binary tree in which the depth of the two subtrees of every node nev....

LeetCode 110. Balanced Binary Tree
文章 2017-12-11 来自:开发者社区

[LeetCode] Balanced Binary Tree 平衡二叉树

Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node neve...

文章 2017-11-14 来自:开发者社区

LeetCode之Balanced Binary Tree 平衡二叉树

这道题目比较简单,一棵树是不是平衡二叉树,可以输入一个结点,计算它的两棵子树的高度差,然后与1比较,递归进行这个操作就可以完成判定。 回顾一下二叉树的概念,平衡二叉树基于二叉查找树(Binary Search Tree), 二叉查找树或者是一棵空树; 或者是具有下列性质的二叉树:(1)若左子树不空,则左子树上所有结点的值均小于它的根结点的值;(2)若右子树不空,则右子树上所有结点的值均大于它的根....

文章 2016-05-05 来自:开发者社区

LeetCode: Balanced Binary Tree 平衡二叉树

判定一棵二叉树是不是二叉平衡树。 链接:https://oj.leetcode.com/problems/balanced-binary-tree/ 题目描述: Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as.....

文章 2015-07-19 来自:开发者社区

leetcode 110 Balanced Binary Tree

Balanced Binary Tree Total Accepted: 63288 Total Submissions: 198315 My Submissions                    &n...

本页面内关键词为智能算法引擎基于机器学习所生成,如有任何问题,可在页面下方点击"联系我们"与我们沟通。

算法编程

开发者社区在线编程频道官方技术圈。包含算法资源更新,周赛动态,每日一题互动。

+关注