Find Bottom Left Tree Value | 3 Approaches | Simple Story | Microsoft | Leetcode 513

Subscribers:
92,300
Published on ● Video Link: https://www.youtube.com/watch?v=YnabMptoE0I



Duration: 23:52
2,990 views
191


Whatsapp Community Link : https://www.whatsapp.com/channel/0029Va6kVSjICVfiVdsHgi1A
This is the 41st Video of our Playlist "Binary Tree : Popular Interview Problems".
In this video we will try to solve a very good Binary Tree problem : Find Bottom Left Tree Value | Leetcode 513

I will explain the intuition so easily that you will never forget and start seeing this as cakewalk EASYYY.
We will do live coding after explanation and see if we are able to pass all the test cases.
Also, please note that my Github solution link below contains both C++ as well as JAVA code.

Problem Name : Find Bottom Left Tree Value | 3 Approaches | Simple Story | Microsoft | Leetcode 513
Company Tags : Microsoft
My solutions on Github(C++ & JAVA) : https://github.com/MAZHARMIK/Interview_DS_Algo/blob/master/Tree/Find%20Bottom%20Left%20Tree%20Value.cpp
Leetcode Link : https://leetcode.com/problems/find-bottom-left-tree-value/


My DP Concepts Playlist : https://youtu.be/7eLMOE1jnls
My Graph Concepts Playlist : https://youtu.be/5JGiZnr6B5w
My GitHub Repo for interview preparation : https://github.com/MAZHARMIK/Interview_DS_Algo
Subscribe to my channel : https://www.youtube.com/@codestorywithMIK
Instagram : https://www.instagram.com/codestorywithmik/
Facebook : https://www.facebook.com/people/codestorywithmik/100090524295846/
Twitter : https://twitter.com/CSwithMIK


Approach Summary :
Approach-1 (Using DFS)
Time Complexity (T.C): O(n)
Space Complexity (S.C): O(max depth of tree)
The depth-first search (DFS) approach uses recursion to traverse the tree and find the bottom-left value. It maintains the maximum depth encountered and updates the bottom-left value accordingly.
Approach-2 (Using BFS)
Time Complexity (T.C): O(n)
Space Complexity (S.C): O(n) for the queue
The breadth-first search (BFS) approach uses a queue to traverse the tree level by level. It updates the bottom-left value during the traversal, ensuring that the last processed node on the bottom-left is returned as the result.
Approach-3 (Using BFS with inner while loop)
Time Complexity (T.C): O(n)
Space Complexity (S.C): O(n) for the queue
This variation of the BFS approach uses an inner while loop to process nodes level by level. It ensures that only the leftmost node at each level is considered for updating the bottom-left value, providing an alternative implementation to the basic BFS approach.

╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗
║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣
╠╗║╚╝║║╠╗║╚╣║║║║║═╣
╚═╩══╩═╩═╩═╩╝╚╩═╩═╝

✨ Timelines✨
00:00 - Introduction
00:55 - Approach-1 (DFS)
07:04 - Coding Approach-1 DFS
09:01 - Approach-2 (BFS - I)
14:07 - Approach-3 (BFS- II)
21:36 - Coding Approach-2 and Approach-3 (BFS - I)


#coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge #leetcodequestions #leetcodechallenge #hindi #india #coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge#leetcodequestions #leetcodechallenge #hindi #india #hindiexplanation #hindiexplained #easyexplaination #interview#interviewtips #interviewpreparation #interview_ds_algo #hinglish #github #design #data #google #video #instagram #facebook #leetcode #computerscience #leetcodesolutions #leetcodequestionandanswers #code #learning #dsalgo #dsa #2024 #newyea




Other Videos By codestorywithMIK


2024-03-04Largest Number formed from an Array | Largest Number | Comparators Application | Leetcode 179
2024-03-02Remove Nth Node From End of List | 1 Pass | 2 Pass | Leetcode 19
2024-03-01Just don't give up. #codestorywithmik
2024-03-01Squares of a Sorted Array | 2 Approaches | Follow Up | Leetcode 977
2024-02-29Maximum Odd Binary Number | 2 Approaches | Leetcode 2864
2024-02-29Comparators in C++ | sort Example | Function Pointer | Functors | Lambda Expressions
2024-02-29Print Longest Common Subsequence | DP On Strings | DP Concepts & Qns-19
2024-02-28Keep moving guys. We are together 💪
2024-02-28Even Odd Tree | DFS | BFS | Leetcode 1609
2024-02-28Permutations II | Two Approaches | Detailed | Recursion Concepts And Questions
2024-02-27Find Bottom Left Tree Value | 3 Approaches | Simple Story | Microsoft | Leetcode 513
2024-02-27Power Set | Same as Subsets | Magic Of Recursion | Recursion Concepts And Questions
2024-02-26Diameter of Binary Tree | Simple Story | Amazon | Leetcode 543
2024-02-26Earliest Second to Mark Indices I | Detailed Intuition | Leetcode Weekly Contest 386 | Leetcode 3048
2024-02-25Generate Parentheses | 2 Approaches | Magic Of Recursion | Recursion Concepts And Questions
2024-02-25Greatest Common Divisor Traversal | Why Graph | Why DSU | Google | Leetcode 2709
2024-02-24Find All People With Secret | 4 Approaches | Google | Leetcode 2092
2024-02-23Thank you and Love You All ❤️🙏
2024-02-23N-Queens | 2 Approaches | Super Detailed | Magic Of Recursion | Recursion Concepts And Questions
2024-02-21Bitwise AND of Numbers Range | 2 Approaches | Dry Run | Leetcode 201
2024-02-19Missing Number | Multiple Approaches | Leetcode 268