mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-24 22:38:57 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>检查子树。你有两棵非常大的二叉树:T1,有几万个节点;T2,有几万个节点。设计一个算法,判断 T2 是否为 T1 的子树。</p>\n\n<p>如果 T1 有这么一个节点 n,其子树与 T2 一模一样,则 T2 为 T1 的子树,也就是说,从节点 n 处把树砍断,得到的树与 T2 完全相同。</p>\n\n<p><strong>注意:</strong>此题相对书上原题略有改动。</p>\n\n<p><strong>示例1:</strong></p>\n\n<pre>\n<strong> 输入</strong>:t1 = [1, 2, 3], t2 = [2]\n<strong> 输出</strong>:true\n</pre>\n\n<p><strong>示例2:</strong></p>\n\n<pre>\n<strong> 输入</strong>:t1 = [1, null, 2, 4], t2 = [3, 2]\n<strong> 输出</strong>:false\n</pre>\n\n<p><strong>提示:</strong></p>\n\n<ol>\n\t<li>树的节点数目范围为[0, 20000]。</li>\n</ol>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 54,
|
||||
"likes": 56,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -161,7 +161,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"19.8K\", \"totalSubmission\": \"27.7K\", \"totalAcceptedRaw\": 19843, \"totalSubmissionRaw\": 27737, \"acRate\": \"71.5%\"}",
|
||||
"stats": "{\"totalAccepted\": \"20.6K\", \"totalSubmission\": \"28.9K\", \"totalAcceptedRaw\": 20625, \"totalSubmissionRaw\": 28873, \"acRate\": \"71.4%\"}",
|
||||
"hints": [
|
||||
"如果T2是T1的子树,它的中序遍历将如何与T1的比较?它的前序和后序遍历如何?",
|
||||
"中序遍历无法告诉我们更多。毕竟,每个具有相同值的二叉搜索树(不管结构如何)将具有相同的中序遍历。这也就是中序遍历的含义:内容是有序的(如果它在二叉搜索树这种特定情况下不起作用,那么对于一般二叉树来说它肯定不起作用)。然而,前序遍历更具指示性。",
|
||||
|
||||
Reference in New Issue
Block a user