Symmetric Tree - Leetcode 101 - Trees (Python)

preview_player
Показать описание


Please check my playlists for free DSA problem solutions:

Best Courses for Machine Learning:
---------------------------------------------------------------------------------------------------------

Best Courses for Statistics:
---------------------------------------------------------------------------------------------------------

Best Courses for Big Data:
---------------------------------------------------------------------------------------------------------

More Courses:
---------------------------------------------------------------------------------------------------------

Full Disclosure:
Please note that I may earn a commission for purchases made at the above sites! I strongly believe in the material provided; I only recommend what I truly think is great. If you do choose to make purchases through these links; thank you for supporting the channel, it helps me make more free content like this!
Рекомендации по теме
Комментарии
Автор

Master Data Structures & Algorithms For FREE at AlgoMap.io!

GregHogg
Автор

Wow. Such a beautiful solution. Excellent work as always Greg!

servantofthelord
Автор

Hey Greg you rock dude! Big fan of your approach.. btw what app are you using for drawing?

DTsertsvadze
Автор

Question: Thanks for the instruction!! love it but one question though. If you call same(root, root) at he beginning, wouldn't you ends up with two identical call stacks and ends up with Time: O(2n) ? Why not do same(root.left, root.right) from the start? I understand you will have to do something to check the initial root and the first two children but the trade off is you have 50% improvement in time, right?

raymondchan
Автор

How about doing a level order traversal and check if every level is a Palindrome.

viswanathvuppala
Автор

Hey greg big fan
From india
Can you please put more binary tree questions already completed what you have posted on binary tree

KRISHNASINGH-iv