Тёмный

Height of a Binary Tree / Maximum depth of a binary tree Algorithm [REVISITED] 

Vivekanand Khyade - Algorithm Every Day
Подписаться 113 тыс.
Просмотров 118 тыс.
50% 1

Find the height of a binary tree. The height of a binary tree is the maximum depth of the binary tree.The height of the root is called the height of the binary tree.

Опубликовано:

 

1 май 2017

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 225   
@codewithree930
@codewithree930 3 года назад
Wow! Finaly I got someone who have deeply explained it..I got the feel... Thanks a lot🙂
@chaminduperera3998
@chaminduperera3998 3 года назад
mmmmm....
@Man_of_Culture.
@Man_of_Culture. 3 года назад
Yep, he gives us the feel of ds
@anandoganiya9070
@anandoganiya9070 3 года назад
not like apna college
@Man_of_Culture.
@Man_of_Culture. 3 года назад
@@anandoganiya9070 both of them are good , I follow many RU-vid channel on DS and Algo because in the end it's about learning and learning .
@anandoganiya9070
@anandoganiya9070 3 года назад
@@Man_of_Culture. ik but they are running which leads to misunderstanding and lots of confusion but this guy explains it just right best for beginners
@vicky888
@vicky888 3 года назад
I've never seen someone has such great patience,really good explanation!
@farahluvs1d
@farahluvs1d 3 года назад
thank you, this is the best most detailed explanation i found,rather than just writing the code and explaining in 5 monutes
@mouseclicker4955
@mouseclicker4955 3 года назад
Looked for explanations everywhere and you were the only one that explained it clearly enough for me to understand. Thank you!
@samyakjain8384
@samyakjain8384 5 лет назад
Explaining recursion is very tough and you explained it in very easy manner
@anupamdey4893
@anupamdey4893 3 года назад
Thank you for the in-depth explanation. No other video on YT explains the recursive calls which is the most imp part of trees.
@danielchia1389
@danielchia1389 4 года назад
This is helped me understand it after watching other videos that didnt explain it as detailed as you. Thank you !!
@VikiSangani
@VikiSangani 5 лет назад
Very easy and to the point explanation. Presentation is also very nice. Thank you for sharing knowledge. Looking forward the same in future.
@amoghgowda6117
@amoghgowda6117 3 года назад
I have seen many videos, Everyone says call the method recursively to find left height and right eight and find the max btw them. But no one told how the code is running line by line. But your the only person who showed how recursion works with 123 way of teaching, Loved the video.
@love_piano_3000
@love_piano_3000 6 месяцев назад
I have literally searched every video related to this topic and this one cleared all my doubts , Thanking you so much Sir... 😃😃😃
@vaishali3339
@vaishali3339 2 года назад
Was about to have a breakdown because I was not getting this problem but your video made it very easy to understand. Thank you for the step by step explanation. धन्यवाद!
@vickyhu6970
@vickyhu6970 4 года назад
You are excellent at explaining things clearly! Thank you for this video.
@KeithWarter
@KeithWarter 4 года назад
Thank you for these videos! They are much appreciated!!!! This stuff needs to be slowed way down to grasp it at first just like a musical instrument. You taking the time to white board it like this is really really helpful.
@jamesqiu6715
@jamesqiu6715 7 лет назад
appreciate you make a revisited video to cover previous doubt on height definition. good job.
@ritik8879
@ritik8879 3 года назад
Excellent explanation for recursion . Really you have a very good understanding of dsa
@jammy2003
@jammy2003 2 года назад
THANKS SOO MUCH!!! I had a great deal of difficulty to understand the recursion portion of this solution! You explained it very easily! Thanks again man!
@pauldaviddavies
@pauldaviddavies 3 года назад
Wow, four years ago yet explaining the concept that deep as if it is being done today. Vivekanand that is great and deep. Thank you. Where are my likes for him guys?
@KamalKumar-bk6rn
@KamalKumar-bk6rn Год назад
Thank you Vivekanand for the clear explanation.
@shivamnerwal72
@shivamnerwal72 3 года назад
You are doing a great work sir , Your tutorials are really very helpful 🙏🙏
@yasirshaikhkhan6189
@yasirshaikhkhan6189 5 лет назад
Thanks sir.... your clear explanations and presentation help better to understood..
@viveknandan4950
@viveknandan4950 Год назад
Never thought someone can explain it so deeply... Thank you so much
@onyinyechichukwuma689
@onyinyechichukwuma689 3 года назад
The best explanation I've seen online. Thanks very much!
@shreyassule2219
@shreyassule2219 3 года назад
Hi Sir, Thank you so much for these videos. Your style of explaining algorithms with examples and then walking us through each step of the code really helps to grasp the concept very effectively. If I may be allowed for just one small suggestion can you also please explain the time complexity for these? Regardless, great fan of your teaching. Keep up the good work!!
@ryujiganaha9645
@ryujiganaha9645 4 года назад
Thank you so much for the great explanation! Big appreciation from Japan
@kartiksuman9814
@kartiksuman9814 2 года назад
very well explained bhaiya....hmko ni lg atha ki mai isse samjh paunga, but you really made it possible...thanks a lot..
@rishabhjaiswal3276
@rishabhjaiswal3276 Год назад
Your are gem sir , I saw so many video but after watching your video I got the how its working , keep posting videos :)
@xiaolongli1898
@xiaolongli1898 4 года назад
There is an error: for the last part: if(left > right) { int h = 1 + left; } else { int h = 1 + right; } return h;
@juanefrainpaquiyauri6590
@juanefrainpaquiyauri6590 4 года назад
glad that somebody else noticed that
@AbdullahKhan-pv1qz
@AbdullahKhan-pv1qz Год назад
you are right, h cant be returned
@chauhanrachit
@chauhanrachit 6 лет назад
Can you please create playlists under your channel ? Like trees, dynamic programming, graph
@jitendragupta4661
@jitendragupta4661 4 года назад
The best explanation!Keep posting!
@arjunsankarlal5296
@arjunsankarlal5296 3 года назад
Very slowly explained in the start. But you made it clear! Thanks :)
@princetiwari7309
@princetiwari7309 2 года назад
thankyou so much sir for such a detailed explanation
@vuramvincent721
@vuramvincent721 2 года назад
Thank you so much !!! you have cleared all the confusion for the algorithm for searching the height of BST
@waynegreen7970
@waynegreen7970 3 года назад
Good content! Detailed and precise explanation!
@FamousEgyptboy
@FamousEgyptboy 6 лет назад
Thank you sir for great explanation !
@nitinmonga6975
@nitinmonga6975 4 года назад
Very well explained sir.. Thank you so much
@vijaysagoo2464
@vijaysagoo2464 3 года назад
Thank you for the in-depth explanation
@souravghosh7093
@souravghosh7093 3 года назад
This is the best explanation i found. Thanks. Need to watch at 2x
@juhisingh4509
@juhisingh4509 4 года назад
Very good explaination of recursion ...Thanku sir
@mohamedelkayal8871
@mohamedelkayal8871 7 лет назад
Your videos have been very helpful
@preetichauhan3272
@preetichauhan3272 6 лет назад
Thanks Vivekanand for your videos, your algorithms helps me a lot in learning Java.
@shivamkeshri
@shivamkeshri 3 года назад
Item 😚
@rishipalbhatia
@rishipalbhatia 6 лет назад
If you compile this code, you will get an error on the line return h; That's because the two declarations of variable h are inside the scope of if { } and else { }. You're trying to use h outside it's scope.
@sunitamishra5475
@sunitamishra5475 2 года назад
Finally someone explained it....thank you so much
@bryanlee5522
@bryanlee5522 Год назад
Thank you, I understand after seeing step by step
@deepakborah8335
@deepakborah8335 6 лет назад
Very good explanation.
@SICSSonamSharma
@SICSSonamSharma 2 года назад
Amazing explanation!
@ShreyasGaonkar
@ShreyasGaonkar 3 года назад
Great explanation on this and the video about the diameter of a tree. Was able to solve the leetcode question on the first go. Sub'ed :)
@prathameshautade2679
@prathameshautade2679 3 года назад
Really good explanation, keep up the good work
@raunak02
@raunak02 3 года назад
Thanks a lot sir, you have removed all my confusion created by my prof.
@srilekha9177
@srilekha9177 5 лет назад
Thanks a ton. Clear explanation.
@saldanhakaren1
@saldanhakaren1 6 лет назад
really good videos, looking forward to more content
@prashanthchinthilla3968
@prashanthchinthilla3968 3 года назад
By this i learned recursion too thanks:)
@DeepakGupta-pt5rv
@DeepakGupta-pt5rv 7 лет назад
Sir,You are the best!!
@shreyasangane3822
@shreyasangane3822 4 года назад
Your are Awesome !!!!!!!!!!!!!!!!!!!!! You made it very simple and clear.
@MrRimmy
@MrRimmy 6 лет назад
VERY GOOD EXPLAINATION
@natesh1
@natesh1 6 лет назад
thank you so much, for these videos. Awesome work
@shilpitamedhi3204
@shilpitamedhi3204 3 года назад
great explanation thank u sir
@itis_beard_man2471
@itis_beard_man2471 4 года назад
Good, I understand this very easily thank you!
@ashishchaudhari8223
@ashishchaudhari8223 3 года назад
Thnks sir by explaing thic concept of maxdepth and also recursion function
@m.motivation6299
@m.motivation6299 2 года назад
The best explanation ever
@codelover847
@codelover847 6 лет назад
Great explanation👍👍
@aditi_jha
@aditi_jha 3 года назад
Best explanation ever!!!!
@sagarkolhe5927
@sagarkolhe5927 4 года назад
great job vivekanand....
@Gudsan
@Gudsan 4 года назад
very nice explanation sir
@jaysahu357
@jaysahu357 7 лет назад
very nice explaination sir
@badal1985
@badal1985 5 лет назад
thank you for the excellent videos!
@JasPer22996
@JasPer22996 3 года назад
Well said. Good explanation. Greetings from new york...... Cubao
@rgurjaryoutification
@rgurjaryoutification 6 лет назад
great explanation....Thanks
@mdanishossain026
@mdanishossain026 Год назад
Tremendous explainatio sir, ❤from BD
@mfgucluer
@mfgucluer 11 месяцев назад
THANK YOU VERY MUCH SIR. Your ability to express is very good.
@vivekanandkhyade
@vivekanandkhyade 11 месяцев назад
You are most welcome
@ashaykapoor613
@ashaykapoor613 3 года назад
Thanks, buddy! It really Helped
@ArunKumar-gp2vq
@ArunKumar-gp2vq 3 года назад
Thank you so much brother you are doing great job
@18ajai
@18ajai 4 года назад
Very well Explained
@revanth9272
@revanth9272 3 года назад
thank you sir. worth to watch your videos..!!
@vivekmit
@vivekmit 4 года назад
In a nut-shell ,we are traversing the a binary tree to count the level at each node. Can you brief we, which kind of binary traversal we implemented in this video ? Can we implement same logic with different kind of traversal like inoder/preorder ?
@amangarg6531
@amangarg6531 7 лет назад
sir please make the video on clone a binary tree with random pointers and also bactracking concept. your videos are very helpful for us🙂
@piyushsharma1638
@piyushsharma1638 5 лет назад
I really liked the way you show small details like, why we add 1 in finding the height of a binary tree, most of of the videos simply add 1 and not explain any reason behind it, i know it is easy part but at least you explained.
@harshitrathi3077
@harshitrathi3077 3 года назад
1should not be added , he is wrong
@gauravbhagat8831
@gauravbhagat8831 3 года назад
Got in one go thank you Vivekanand !
@m_arslan_
@m_arslan_ 3 года назад
Thank you, sir! you really helped me
@azizas9366
@azizas9366 6 лет назад
I like your explanation algorithm
@tapanjeetroy8266
@tapanjeetroy8266 5 лет назад
Thanks a lot for uploading it
@gokarnapandey4930
@gokarnapandey4930 3 года назад
Wow sir 🥰🥰....I could not hold myself to appreciate your explanation... Thank you sir...
@Anonymous-jt3yz
@Anonymous-jt3yz 5 лет назад
Best Explanation Ever
@maazalam66
@maazalam66 6 лет назад
Really nice explanation. ...thank you ...keep making videos
@coderajput1816
@coderajput1816 6 лет назад
no it is not working properly....if any mistake in my code then please comment i uploaded the code in my comment
@100_bindusai8
@100_bindusai8 3 года назад
Easy to understand 😀😊
@siddheshmahadeshwar8691
@siddheshmahadeshwar8691 3 года назад
Good job man! Thank you
@chetanjain5097
@chetanjain5097 Год назад
You explain better than anyone else. Most videos explain logic but don't have code. You do show code. But I just haven't seen any single video that explains with test cases (with input data) and code. After viewing your video I am still now sure what value of node is passed to the function. Is it pointers to left and right edge or is it something else?
@harshitraj4199
@harshitraj4199 3 года назад
finally mil hi gya.... thanks a lot
@shyamaharihar2425
@shyamaharihar2425 3 года назад
Thankyou so much , finally understood :)
@priyankadey3337
@priyankadey3337 3 года назад
Thank you so much!
@ankitathakur5989
@ankitathakur5989 4 года назад
Thanku so much sir ji
@tumble_dont_fall
@tumble_dont_fall 4 года назад
best explanation on the internet
@LarryRuane
@LarryRuane 7 лет назад
Thanks, great explanation. Just one small suggestion with the code -- the variable h is declared locally within the "if" and "else" blocks, so is no longer in scope for the "return" statement. So you would need to declare h before the "if" statement.
@usman3D
@usman3D 6 лет назад
Exactly my thoughts
@manjotkaur6731
@manjotkaur6731 3 года назад
it is really helpful
@ashwinsingh1731
@ashwinsingh1731 3 года назад
finally found what i needed ... thank you sir
@vivekanandkhyade
@vivekanandkhyade 3 года назад
Welcome 👍
@prithwishdasgupta4508
@prithwishdasgupta4508 5 лет назад
Best explanation!!! :-)
@ridimamittal4064
@ridimamittal4064 3 года назад
THANK YOU SO MUCH SIR, THANKS A TON!!!
@namesignaturewitharooj3481
@namesignaturewitharooj3481 2 года назад
Thank you sooooo much sir
@SilentNight_Tour
@SilentNight_Tour 3 года назад
Good job sr
@jean-paulboga8189
@jean-paulboga8189 2 года назад
Good job 👍
@modernsanskari4398
@modernsanskari4398 7 лет назад
In step 3 you can directly write. h = max(left , right) + 1; return h;
@yoonlee5278
@yoonlee5278 5 лет назад
I think he meant to explain purely used conditional statement for the people to understand more easily.
@reyou7
@reyou7 5 лет назад
You can take entire code, and put in a text box, and turn into a single line. shorter != better.
Далее
Delete a Binary Tree (all nodes in the binary tree)
8:13
Vertical Order Traversal of a Binary tree (Algorithm)
18:35
БИМ БАМ БУМ💥
00:14
Просмотров 4,6 млн
Diameter of a Binary Tree (Code/ Algorithm)
17:15
Просмотров 94 тыс.
Hash Tables and Hash Functions
13:56
Просмотров 1,5 млн