Leetcode Blind 75 C++: Maximum Depth of Binary Tree

preview_player
Показать описание
Hey Everyone, Im going over the Blind 75, so decided to make a series on them to help solidify concepts prior to interviews. Below I have attached my notes from doing questions and if have any other questions feel free to let me know!

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

I don't understand, this seems over simplified.

If the right leaf node 20 splits left, and then had an additional leaf node below 15, wouldn't your function miss it? I think what you've written here's just goes all the way to the left, then all the way to the right and then returns the furthest one?

Or does maxDepth do these internal leaf node checks itself?

davidhallinen-lics
welcome to shbcf.ru