Balanced Binary Tree - Leetcode 110 - Trees (Python)

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


Please check my playlists for free DSA problem solutions:

My Favorite Courses:

Data Structures & Algorithms:

Python:

Web Dev / Full Stack:

Cloud Development:

Game Development:

SQL & Data Science:

Machine Learning & AI:
Рекомендации по теме
Комментарии
Автор

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

GregHogg
Автор

I learned Diameter of Binary Tree - Leetcode 543 - Binary Trees (Python) from your video and was instantly able to solve this problem! I found defining the global variable like this way more intuitive than other solutions I've found. Thank you so much!

myko_chxn
Автор

best explanation of leetcode problems on Youtube, independent of any language. I can easily submit my solution in JS.

himanshugusain
Автор

Thanks Greg.
Because, I really understand your videos.
I could solve it easily because I watched your other video where we have to get the max height

saleheen
Автор

Clean code and great explanation Thanks Greg!

Mahi.t
Автор

In the unbalanced condition just return -1 and check in the same condition for -1. Then return height(root) != -1. It's faster because all the height calculations are returned early and you have no need for a global variable.

LastVoyage
Автор

concise and great explanation thanks Greg!

ipsitadas
Автор

your solution for the same problem in code is different in c++ pls also try to explain that in such cases

samriddhibharadwaj
Автор

Why you're adding 1 on return of method ? Is this adding the root node ?

luancabral
Автор

Would prefer if you briefly summarized why we use a list instead of having me go to another video 😅.

ColeHartman