mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-05 07:21:40 +08:00
存量题库数据更新
This commit is contained in:
@@ -1,27 +1,21 @@
|
||||
<p>Given a binary tree, determine if it is height-balanced.</p>
|
||||
|
||||
<p>For this problem, a height-balanced binary tree is defined as:</p>
|
||||
|
||||
<blockquote>
|
||||
<p>a binary tree in which the left and right subtrees of <em>every</em> node differ in height by no more than 1.</p>
|
||||
</blockquote>
|
||||
<p>Given a binary tree, determine if it is <span data-keyword="height-balanced"><strong>height-balanced</strong></span>.</p>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Example 1:</strong></p>
|
||||
<p><strong class="example">Example 1:</strong></p>
|
||||
<img alt="" src="https://assets.leetcode.com/uploads/2020/10/06/balance_1.jpg" style="width: 342px; height: 221px;" />
|
||||
<pre>
|
||||
<strong>Input:</strong> root = [3,9,20,null,null,15,7]
|
||||
<strong>Output:</strong> true
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 2:</strong></p>
|
||||
<p><strong class="example">Example 2:</strong></p>
|
||||
<img alt="" src="https://assets.leetcode.com/uploads/2020/10/06/balance_2.jpg" style="width: 452px; height: 301px;" />
|
||||
<pre>
|
||||
<strong>Input:</strong> root = [1,2,2,3,3,null,null,4,4]
|
||||
<strong>Output:</strong> false
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 3:</strong></p>
|
||||
<p><strong class="example">Example 3:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> root = []
|
||||
|
Reference in New Issue
Block a user