Minimum Depth of Binary Tree | Leetcode-111 | BFS | DFS | AMAZON | Explanation ➕ Live Coding

preview_player
Показать описание
Hi everyone, this is the 28th video of our "Binary Tree" Playlist.
In this video we will try to solve a BFS,DFS Binary Tree Qn “Minimum Depth of Binary Tree”.

We will write very easy and clean code.
We will do live coding after explanation and see if we are able to pass all the test cases.

Problem Name : Minimum Depth of Binary Tree
Company Tags : AMAZON

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

#coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge #leetcodequestions #leetcodechallenge #hindi #india #hindiexplanation #hindiexplained #easyexplaination #interview #interviewtips
#interviewpreparation #interview_ds_algo #hinglish
Рекомендации по теме
Комментарии
Автор

Great Explanation!! Please make videos on other topics as well.

pankhurip
Автор

Story se Maine bhi code kardiya. Thanks to you ❤

wearevacationuncoverers
Автор

Did it under a minute (min/max depth sunte hi dfs ata h dimag mein, thnx for the bfs wali approach)

xiaoshen
Автор

badiya question, usse bhi badiya teacher, kudos to u, plz keep posting more questions like these.

DurgaShiva
Автор

Please keep adding similar questions!
It's of great help!

AyushRaj-weog
Автор

thanks for the explanation. finally an easy one by leetcode

floatingpoint
Автор

Bhaiya abhi graphs ki concepts and question series hold PE hai kya?
I've reached till video 20/33 and it's just amazing how clearly and smoothly one is able to grasp the concepts... Thanks a lot 🙏🏻

daayush
Автор

Amazing as always. Would like to request again for top interview questions, Sir❤

aman
Автор

Mine solution for this Problem

class Solution {
public:
int solve(TreeNode*root){
if(root==NULL)return 1e9;
if(root->left==NULL and root->right==NULL)return 1;
int mini=1e9;
mini=min(mini, 1+solve(root->left));
mini=min(mini, 1+solve(root->right));
return mini;
}
int minDepth(TreeNode* root) {
int ans=solve(root);
ans=ans>=1e9?0:ans;
return ans;
}
};

Anand
Автор

Pesudocode of today POTD
If(root==0)
{
Return 0;

// check for the left sub tree

// check for the right sub tree

// After it will check for the condition of from which one will be the minimum

// else it will check for the maximum condition for the both the left sub tree and right sub tree


T.c:- O(N)
S.C :- O(N)

aryamansingha
Автор

Can you please give your intuition and your thought process for the Question Minimize the heights I and II of GFG.

monty
Автор

bhai, can you cmplete the graph and dp playlist in 2 or 3 weeks ?

tejaspatel
Автор

Thanks sir..
Please take the question-- farthest element (using binary search) ... not able to get it....

keerti_
welcome to shbcf.ru