DSA in Python – Height of Binary Tree | DFS & BFS Approaches | Leetcode 104 – Part 110 [Hindi]
7.7K views on YouTube
π Welcome to Part 110 of Code & Debugβs DSA Python Course!
In this lecture, we solve Leetcode 104: Maximum Depth of Binary Tree, also known as the height of a binary tree. We explore two powerful solutions:
1οΈβ£ DFS (Recursive)
2οΈβ£ BFS (Level Order Traversal using Queue)
π What youβll learn in this video:
β
What is the height of a binary tree and how itβs defined
β
Recursive DFS approach to calculate max depth
β
BFS approach using deque for level-by-level height calculation
β
Time & space complexity of both solutions
β
Visual dry run of both approaches
π Practice the problem on Leetcode:
π https://leetcode.com/problems/maximum-depth-of-binary-tree/
π Refer to the article for better understanding:
π https://codeanddebug.in/blog/maximum-depth-of-binary-tree/
π π Access the full YouTube DSA Playlist Sheet (All Questions in Order):
π https://docs.google.com/spreadsheets/d/1AWE15Fy3wD2iqu2vjK_R7cCiuvSsjYQclcdZmHpF66o/edit?usp=sharing
π Enroll in this FREE DSA Python course here:
π https://codeanddebug.in/course/master-dsa-with-leetcode
π Enroll for Self-Paced Advanced DSA course here:
π https://codeanddebug.in/course/zero-to-hero-python-dsa
π Thank you for supporting Code & Debug! Donβt forget to like, share, and subscribe to our channel. Hit the π bell icon to stay updated with our latest lectures.
#BinaryTree #TreeHeight #MaxDepth #DFS #BFS #Leetcode104 #PythonDSA #DSAPythonCourse #CodeAndDebug #TreeTraversal #CodingInterviews #Part110