Maximum Depth of Binary Tree - Leetcode 104 - Trees (Python)

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


Please check my playlists for free DSA problem solutions:

Best Courses for Analytics:
---------------------------------------------------------------------------------------------------------

Best Courses for Programming:
---------------------------------------------------------------------------------------------------------

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
Автор

I appreciate you recording all these! Please keep them coming :)

onurucar
Автор

Very helpful Greg. Questions - how easy is it to replicate the leetcode code into say visual code (python of course) including maintaining the TreeNode and Solution classes and supplying the tree root structure? I'm not looking for leetcode extension in VSC. I read somewhere you need to deserialise leetcode's root format, but is it possible to feed in the root (through brute force)? Not seeing what is behind leetcode's test environment is limiting learning for me.

RayWhitbyCreations
Автор

Gregg, can you explain why recursive execution of self.maxDepth gives us a length of the side of the tree? I don't see any counting isinde of the maxDepth function. I don't get it.

nitnatsnokk
Автор

Can someone recommend me some visaulization platforms to see how the code and logic works together? For example, the recursive calls. I am not 100% with recursion so wanted to see it

anmolacharya
Автор

Nice. By the way, could the space complexity ever become log(n) ? Thanks for the vid!

helloworldcsofficial