1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-13 19:31:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

add leetcode problem-cn part2

This commit is contained in:
2022-03-27 20:38:29 +08:00
parent 5a4fa6db12
commit 0fc7f4b734
1617 changed files with 134637 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
<p>输入两棵二叉树A和B判断B是不是A的子结构。(约定空树不是任意一个树的子结构)</p>
<p>B是A的子结构 即 A中有出现和B相同的结构和节点值。</p>
<p>例如:<br>
给定的树 A:</p>
<p><code>&nbsp; &nbsp; &nbsp;3<br>
&nbsp; &nbsp; / \<br>
&nbsp; &nbsp;4 &nbsp; 5<br>
&nbsp; / \<br>
&nbsp;1 &nbsp; 2</code><br>
给定的树 B</p>
<p><code>&nbsp; &nbsp;4&nbsp;<br>
&nbsp; /<br>
&nbsp;1</code><br>
返回 true因为 B 与 A 的一个子树拥有相同的结构和节点值。</p>
<p><strong>示例 1</strong></p>
<pre><strong>输入:</strong>A = [1,2,3], B = [3,1]
<strong>输出:</strong>false
</pre>
<p><strong>示例 2</strong></p>
<pre><strong>输入:</strong>A = [3,4,5,1,2], B = [4,1]
<strong>输出:</strong>true</pre>
<p><strong>限制:</strong></p>
<p><code>0 &lt;= 节点个数 &lt;= 10000</code></p>