mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-26 07:18:56 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一棵<strong> 完全二叉树</strong> 的根节点 <code>root</code> ,求出该树的节点个数。</p>\n\n<p><a href=\"https://baike.baidu.com/item/%E5%AE%8C%E5%85%A8%E4%BA%8C%E5%8F%89%E6%A0%91/7773232?fr=aladdin\">完全二叉树</a> 的定义如下:在完全二叉树中,除了最底层节点可能没填满外,其余每层节点数都达到最大值,并且最下面一层的节点都集中在该层最左边的若干位置。若最底层为第 <code>h</code> 层,则该层包含 <code>1~ 2<sup>h</sup></code> 个节点。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n<img alt=\"\" src=\"https://assets.leetcode.com/uploads/2021/01/14/complete.jpg\" style=\"width: 372px; height: 302px;\" />\n<pre>\n<strong>输入:</strong>root = [1,2,3,4,5,6]\n<strong>输出:</strong>6\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>root = []\n<strong>输出:</strong>0\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>root = [1]\n<strong>输出:</strong>1\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li>树中节点的数目范围是<code>[0, 5 * 10<sup>4</sup>]</code></li>\n\t<li><code>0 <= Node.val <= 5 * 10<sup>4</sup></code></li>\n\t<li>题目数据保证输入的树是 <strong>完全二叉树</strong></li>\n</ul>\n\n<p> </p>\n\n<p><strong>进阶:</strong>遍历树来统计节点是一种时间复杂度为 <code>O(n)</code> 的简单解决方案。你可以设计一个更快的算法吗?</p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 649,
|
||||
"likes": 669,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Closest Binary Search Tree Value\", \"titleSlug\": \"closest-binary-search-tree-value\", \"difficulty\": \"Easy\", \"translatedTitle\": \"\\u6700\\u63a5\\u8fd1\\u7684\\u4e8c\\u53c9\\u641c\\u7d22\\u6811\\u503c\"}]",
|
||||
@@ -155,7 +155,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"162.6K\", \"totalSubmission\": \"205.1K\", \"totalAcceptedRaw\": 162630, \"totalSubmissionRaw\": 205135, \"acRate\": \"79.3%\"}",
|
||||
"stats": "{\"totalAccepted\": \"173.3K\", \"totalSubmission\": \"218K\", \"totalAcceptedRaw\": 173298, \"totalSubmissionRaw\": 217953, \"acRate\": \"79.5%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
|
||||
Reference in New Issue
Block a user