Same Tree | Recursive and Iterative | Leetcode - 100

preview_player
Показать описание
The day 13 problem in July Leetcoding Challenge. ( Same Tree ).

0:48 Recursive Approach
2:02 Iterative Approach

Check out our other popular playlists:

Problem statement:

Given two binary trees, write a function to check if they are the same or not.

Two binary trees are considered the same if they are structurally identical and the nodes have the same value.

Example 1:

Input: 1 1
/ \ / \
2 3 2 3

[1,2,3], [1,2,3]

Output: true
Example 2:

Input: 1 1
/ \
2 2

[1,2], [1,null,2]

Output: false
Example 3:

Input: 1 1
/ \ / \
2 1 1 2

[1,2,1], [1,1,2]

Output: false

If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful.

#coding #interview #programminglife #programmingisfun #programmer #tech #software #codinglife #leetcode
Рекомендации по теме
Комментарии
Автор

I hope you all are enjoying the July leetcoding challenge!!! Don't forget to leave a comment!!! Please like the video to support us!!!
Questions you might like:
Struggling in a question??
Leave in a comment and we will make a video!!!🙂🙂🙂

AlgorithmsMadeEasy