LeetCode 101. Symmetric Tree [Solution + Code Explained ]

preview_player
Показать описание
One of the most frequently asked coding interview questions on Dynamic Programming in companies like Google, Facebook, Amazon, LinkedIn, Microsoft, Uber, Apple, Adobe etc.

LeetCode 101. Symmetric Tree

Question : Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).

For example, this binary tree [1,2,2,3,4,4,3] is symmetric:

1
/ \
2 2
/ \ / \
3 4 4 3


But the following [1,2,2,null,3,null,3] is not:

1
/ \
2 2
\ \
3 3


Follow up: Solve it both recursively and iteratively.

Рекомендации по теме
Комментарии
Автор

Brilliant video thank you for the great explanation of the code, very helpful

pierschandler
Автор

Why u write return after base condition

princechoudhary
Автор

the way you explain each line of the code is great..!! :))))

kalpanameena