Skip to content

Commit add2a61

Browse files
committed
Added README.md file for Same Tree
1 parent 028632c commit add2a61

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

100-same-tree/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<h2><a href="https://leetcode.com/problems/same-tree">Same Tree</a></h2> <img src='https://img.shields.io/badge/Difficulty-Easy-brightgreen' alt='Difficulty: Easy' /><hr><p>Given the roots of two binary trees <code>p</code> and <code>q</code>, write a function to check if they are the same or not.</p>
2+
3+
<p>Two binary trees are considered the same if they are structurally identical, and the nodes have the same value.</p>
4+
5+
<p>&nbsp;</p>
6+
<p><strong class="example">Example 1:</strong></p>
7+
<img alt="" src="https://assets.leetcode.com/uploads/2020/12/20/ex1.jpg" style="width: 622px; height: 182px;" />
8+
<pre>
9+
<strong>Input:</strong> p = [1,2,3], q = [1,2,3]
10+
<strong>Output:</strong> true
11+
</pre>
12+
13+
<p><strong class="example">Example 2:</strong></p>
14+
<img alt="" src="https://assets.leetcode.com/uploads/2020/12/20/ex2.jpg" style="width: 382px; height: 182px;" />
15+
<pre>
16+
<strong>Input:</strong> p = [1,2], q = [1,null,2]
17+
<strong>Output:</strong> false
18+
</pre>
19+
20+
<p><strong class="example">Example 3:</strong></p>
21+
<img alt="" src="https://assets.leetcode.com/uploads/2020/12/20/ex3.jpg" style="width: 622px; height: 182px;" />
22+
<pre>
23+
<strong>Input:</strong> p = [1,2,1], q = [1,1,2]
24+
<strong>Output:</strong> false
25+
</pre>
26+
27+
<p>&nbsp;</p>
28+
<p><strong>Constraints:</strong></p>
29+
30+
<ul>
31+
<li>The number of nodes in both trees is in the range <code>[0, 100]</code>.</li>
32+
<li><code>-10<sup>4</sup> &lt;= Node.val &lt;= 10<sup>4</sup></code></li>
33+
</ul>

0 commit comments

Comments
 (0)