@@saimadib well now even branches other than CS/IT needs it : }
@saimadib Жыл бұрын
@@aryan20052 it actually sucks 😔
@hardikjuneja14 ай бұрын
@@saimadib why?? infact dsa requires way more thinking than dev
@abhinav49552 жыл бұрын
At line 129 and 130 at 38:15. It should be pair left and pairright
@tusharvaish80962 жыл бұрын
No issues of using int , int you can use any data type inside the pair
@Mkhuss5 ай бұрын
yes, but int can be typecasted to bool, so no error
@animeshsahoo-yo1tt17 күн бұрын
both works true false will chnge into 1 and 0
@vishnubishnoi462113 күн бұрын
hey brother i am currently doing this course currently and you have done this at that time can you give me a review and if some mistakes that you did while following this course that i should not do.
@sherebanoburhani89392 жыл бұрын
This course is pure diamond! Rare and unique! Loved the consistency, way of explanation, content, notes, questions,etc..
@vishnubishnoi462113 күн бұрын
@sherebanoburhani8939 hey brother i am currently doing this course currently and you have done this at that time can you give me a review and if some mistakes that you did while following this course that i should not do.
@sciencestreamers85092 жыл бұрын
Yaar , itne ache se tree koi bhi nhi kraata, jitne ache se aap ne krvaya ❤️❤️❤️❤️❤️
@GaneshBhutekar-nu1gd2 ай бұрын
Started my coding journey in the fourth year with this playlist and I'm lucky I found you, sir. No one else suggested a playlist to me.
@blyatman4 Жыл бұрын
Bhai tu actually mei bade bhai waali feel deta hai padhane mei, just checked out your channel for the first time, I am learning dsa in Java but I needed some question based objective explanation of applying Binary Trees and teri algorithmic explanation bahaut help krti hai.. Means alot Thanks
@suvigyabasnotra73782 жыл бұрын
This is the most appropriate length of lectures we need with the right quantity of questions per video.
@uttampratapsingh93214 ай бұрын
Q.2 approach #3 int answer(Node* root,int &dia){ if(root==NULL){ return 0; } int left=answer(root->left,dia); int right=answer(root->right,dia); int maxi=left+right+1; dia=max(dia,maxi); int ans=max(left,right)+1; return ans; } int diameter(Node* root) { int dia=INT_MIN; int ok=answer(root,dia); return dia; }
@BTCMEAbrar Жыл бұрын
really i am watching these lectures a year after they are uploaded , and it is so beneficial for me.
@yugbhadana93922 жыл бұрын
This series is one for the ages ⭐ . Consistency and Content (Never seen before by any creator) 💯 . Lots of respect for you Love Babbar bhaiya ♥
@vishnubishnoi462113 күн бұрын
@yugbhadana9392 hey brother i am currently doing this course currently and you have done this at that time can you give me a review and if some mistakes that you did while following this course that i should not do.
@suvigyabasnotra73782 жыл бұрын
It's nice that the Part 1 constituted all Easy and Medium questions to strengthen our fundamentals and give us some confidence pertaining to the topic.
@Stefan_2117 Жыл бұрын
We can also just create a single function named height and add a reference variable ans in its argument to calculate ans = max ( ans , height of left + right + 1) for diameter
@AdityaPandey-ek5vq Жыл бұрын
In 41:15 pair should be there instead of as we are storing bool left.first
@SATYAJEETSEN-vc7sl29 күн бұрын
no matter... because true itself ko 1 represents karta hai and false as 0 ... so baad mein compiler jab 1 dekhega toh it will interpret it as true
@divyagupta6854 Жыл бұрын
None of my friends are preparing for DSA, and I am the only one right now who is doing it, so none was able to guide me what to prepare. Now I am sure what all things to prepare, and basic concepts are must for every topic I realized. I will keep on revising old things so I never forget such treasure content I learned from this video.
@rishabhkesarwani95062 жыл бұрын
Love the way you approach the concept, it makes it easier and feels like the vibes are matching
@abhirupmajumder86202 жыл бұрын
Really this course is a golden box for generations to come
@alexrcrew19752 жыл бұрын
yes where u work
@aishwaryaporwal23212 жыл бұрын
Babbar bhaiya is the best 💯💯 u r out of expectation...as u r helping alot of students through this god bless u for ur good work♥️
@gourangpathak44432 жыл бұрын
Using Pairs/lists as return type to do and return computations is one nice trick for optimization 😄 Great Lecture 👍
@KYOUMI53 ай бұрын
height and diameter approach will give us an ability to think and solve almost all the problems in tree
@piyushkumar-qo4tn2 жыл бұрын
This is #*THE BEST*Course for DSA babbar bhai aapne bohot jyade mehnat aur pyar se iss course ko banaya hai thank you very much
@vishnubishnoi462113 күн бұрын
@piyushkumar-qo4tn hey brother i am currently doing this course currently and you have done this at that time can you give me a review and if some mistakes that you did while following this course that i should not do.
@karanborana85402 жыл бұрын
Just finished. Your teaching is so good, that from last 3-4 videos I usually pause the video, try to solve the problem and then compare with your approach. The content quality is top notch !🙌😍
@HarshSharma-fr1ek2 жыл бұрын
Dry run for every program is absolutely amazing thank you for that💯💯
@garg-s1s Жыл бұрын
introducing Greatest Teacher Ever Mr Love Babbar Sir ji
@rishabhchaturvedi81282 жыл бұрын
the way you are teaching is awesome sir......i really solute you sir for your great effort ....the main part of thid course is the sequence to solve any question question ->approach ->code->dryrun.....is really help to beginners .........geniune course.....structured in such manner so that you can easily change your level of coding an can crack placement ....
@eklavya22k34 Жыл бұрын
This is ultimate course, pure Gem, Gold, platinum, diamond, all.
@vidursharma00018 ай бұрын
Best of Best Lectures, I think, No one can Teach us Like this, where Babbar Sir repeat a thing 3-4 times, untill a student is able to understand the logic/problem. I am very very thankful to @Love Babbar Sir
@gamingunzipped50564 ай бұрын
Another Optimize Solution and Easy To Understand Without using the pair method O(n) :- int diameter(Node* root) { int diameter_ = 0; solve(root, diameter_); return diameter_; } int solve(Node* root, int &diameter){ if(root == NULL){ return 0; } int LHS = solve(root->left, diameter); int RHS = solve(root->right, diameter); diameter = max(diameter, (LHS+RHS)+1); return 1 + max(LHS,RHS); }
@user-nw9qu5vm8f5 ай бұрын
At 38:15 in pair of left and right u used instead of
@SATYAJEETSEN-vc7sl29 күн бұрын
no matter... because true itself ko 1 represents karta hai and false as 0 ... so baad mein compiler jab 1 dekhega toh it will interpret it as true
@kunalmodiart Жыл бұрын
completed height, diameter, balanced or not questions using your help... final 2 questions i was able to do on my own 🔥thanks babbar bhaiya your videos are helping alot
@abhinav49552 жыл бұрын
A Simple Solution with TC:- O(n), SC:- O(n) int height(Node *root){ if(root==NULL) return 0; int leftH = height(root->left); int rightH = height(root->right); if(leftH ==-1 or rightH==-1) return -1; if(abs(leftH-rightH)
@MMNayem-dq4kd Жыл бұрын
Thank you.
@lipibanerjee8635 ай бұрын
Such in-depth videos! Thank you so much for teaching from basics to advanced... Please keep making such knowledge loaded sessions.
@bishalchatterjee7452 жыл бұрын
Are bhaiya Trees actually me itna easy hain ki aap isee easily samjha rahe ho.. Ye to bilkul by heart samajh aagyaa..!!
@rajeshdhadake37102 жыл бұрын
This is #*THE BEST*Course for DSA babbar bhai aapne bohot jyade mehnat aur pyar se iss course ko banaya hai thank you very much I have wasted my money in paid course Love babbar bhai if you are reading this comment please reply or give me heart
@newsthe_video Жыл бұрын
waah maja aagaya ,1 mahine ke baad Binary tree achhe se samjhme aa hi gaya Thanks bhaiya
@rajmohnani7194 Жыл бұрын
bhaiya pehle height of the tree level order traversel wale method mai null ke andar ek count variable bana ke kr diya tha firr resume kiya toh dekha aap recursively kr rhe hai toh firr rok ke try kiya ek baar khud se concept clear ho gya...maja aara hai.😁
@ninjahattori41012 жыл бұрын
by the way kudos to ur consistency and the efforts that u r putting to bring this course really appreciate ur efforts and hardwork
@ashmeetsinghkalsi25802 жыл бұрын
I am sorry about your brother bro. RIP Shinzo abe😭😭
@vedant6460 Жыл бұрын
Hi, Qs 2 and Qs 3 in my opinion it could have been explained in a more simplified way For example: For Qs 3: no need for the pair and all of those things just pass a reference of and variable to height function and add an if condition in the height function that whenever the difference between height of the left subtree and right subtree is more than 1, then you will change the value of ans and based on the value of ans in the isBalanced function, you will return True or False which mean just with 3-4 extra lines (easy to understand) we could have solved the qs, by just taking the code from previous qs This is my opinion, but the course is really nice, I have been following along since long time Thanks a lot
@bittuop4941 Жыл бұрын
apna channel ban le bhai tu
@Nishant-n8e10 ай бұрын
yes its correct i am also done with pass by refrance but in higher Q. pair will be more suitaible
@easyTocodebyManish2 жыл бұрын
.....ONLY VIDEO IN WHICH THIS TREE QUESTIONS EXPLAINED IN VERY EASY WAY SO THAT ANY ONE CAN UNDERSTAND..... THANK YOU
@prachigupta46055 ай бұрын
This is the best, question basics are also covered, not covered in dsa course by pulkit, course in detail needed, so great quantity
@prashantbirajdar92712 жыл бұрын
wahh bhiya mazaa aa gya ekdum..bhut badiya tarike se smajhaya hai apne...sub samaj gaya ..
@the_vishaal262 ай бұрын
Shuru majboori me kiye the par ab maja aa raha hai.
@ViratKohli-pp4twАй бұрын
dil jit liya sir .. ek no explanation
@infernalshorts65337 ай бұрын
wahhh ky bat h ky bat h, youtube free course me itni badia explanation 😍
@vmstudy99657 ай бұрын
Bhaiya 1st and 2nd question dekh k lga ki mere se ni hoga. Jb last tk sbhi questions solve Kiya tb abhi clear hua ki sbhi questions at least smjh to gya. 😌🙂🎉 Or last me solve bhi Kiya
@therock88152 жыл бұрын
Waah bhaiya yese hi course ka hme wait tha aaj se pura playlist start krne ja raha hu aapka thanks for making this type of course
Bhaiya be like = ek baar jo commitment( consistent videos ki) kardi to phir to mein apne aap ki bhi nahi sunta
@anushree37442 жыл бұрын
Please add assignment questions post each lecture, so that we can solidify the concept. Thanks
@empire_subh7 ай бұрын
owa keya baat keya baat ......!! thankyou guru ji.....
@siddharthmisra751 Жыл бұрын
why for left and right call, we use pair instead of in isbalancedfast
@manishchandrapaneru.o57 ай бұрын
One of the best DSA course availiable on youtube.🔥
@varunbhasin578 Жыл бұрын
Waah kya baat h bhiaya !!! feels this word
@shalinisaini37873 ай бұрын
Mjaa Aagya Bhaiyaaa.Thank you so much
@kunalsharma51602 жыл бұрын
kya baat hai ji coding ke badhshah ho kasam se, kamal ki coding krte ho , ye toh bda good hogya ji
@amitprakhar48022 жыл бұрын
why we take pair instead for left
@yashgupta48662 жыл бұрын
Present bhaiya Consistency++; Reach++;
@ajazahmed50792 жыл бұрын
Your videos deserve salute bhaiya, best teacher. Approach batane ka tareeka is next level, I don't think ki paid courses me bhi itna achha padhaate honge, keep it up bhai...
@harshitagarg25444 ай бұрын
you want to quit in between and then he says that I reshot the video because mujhe asa laga ki mai aur ache se sikha sakta hoon....he is op!
@shubhammane53402 жыл бұрын
// it is also one of the solutions int height(Node *root,bool &ans){ if(root==nullptr){ return 0; } int t=height(root->left,ans); int f=height(root->right,ans); if(abs(t-f)>1){ ans=false; } return 1+max(t,f); } bool isBalanced(Node *root) { // Your Code here bool ans=true; int h=height(root,ans); return ans; }
@Child34Shorts2 жыл бұрын
best course on youtube, just wow!!!!🤐🤐
@simplifiedbyparth Жыл бұрын
Mazedaar lecture 😊
@Ktr_7927 ай бұрын
I think tree is now become easiest part of dsa Just because of Babbar bhaiya Thanks a lot
@AmitRaj-nq1df Жыл бұрын
this course helps me to overcome a nightmare like recursion
@070k_muskanagarwal4 Жыл бұрын
Waah kya baat kya baat sir sab kuch samjh me aa raha h starting se h !! Bas revision kaise kre samjh me nhi aa raha. Purane concept thoda bhul rahi ho jo frequently use nhi hote.
@sonaliverma5406 Жыл бұрын
I could not understand how recursion call works in tree question but after watching this video I understood quickly. Thanks bhaiya😇😇
@atharvakamble-f1y Жыл бұрын
just love the way you teach...making me completely understand the topic with ease.💯💯💯💯
@avishkarpatil587110 ай бұрын
22:33 // Diameter of a Binary Tree - Simple Approach int findDiameter(Node* root, int &madmax){ if(root == NULL) return 0; int left = findDiameter(root->left, madmax); int right = findDiameter(root->right, madmax); int dia = left + right + 1; // this will find diameter for each sub-Tree madmax = max(madmax, dia); // the ones diameter which is max store it int height = max(left , right) + 1; return height; } public: // Function to return the diameter of a Binary Tree. int diameter(Node* root) { int madmax = 0; findDiameter(root, madmax); return madmax; }
@AnilKumarPatidar11 Жыл бұрын
This course is totally amazing, no one teaches like you bhaiyya ,Thanku very Much
@eshaanbagga51592 жыл бұрын
Most amazing DSA course on KZbin🙌🙌
@AyushGupta-ji5xp Жыл бұрын
best course for DSA
@Deepanshu__10113 ай бұрын
Qn 3 O(N) class Solution{ public: int height(Node* node, bool &ans){ if(node == NULL)return 0; int left = height(node -> left,ans); int right = height(node -> right, ans); int an = max(left,right)+1; if(abs(left - right) > 1)ans = false; return an; } //Function to check whether a binary tree is balanced or not. bool isBalanced(Node *root) { bool ans = true; int a = height(root, ans); return ans; } };
@varungarg84322 жыл бұрын
😃😃Last Tk dekh rha hu video bhaiya .. Salute Bhaiya... Awesome Playlist..😉😉
@keshavgambhir98942 жыл бұрын
Present Bhaiya. Consistency is op. Attended all lectures uploaded till date
@AnanditaTiwari-c7m Жыл бұрын
i can never get bored in ur lecture..........u r my mentor sir, one day i will pakka meet you
@preetkatiyar9692 жыл бұрын
Bhaiya really your teaching skill is very top notch noone can beat and you are the best teacher and inspiration for us Thank u so much bhaiya
@SahilGupta-cd8lc Жыл бұрын
41:00 wale code me pair left = isbalanced(root->left); hona chiye tha na. aapne pair left leke krdia or chl bhi rha code. jb root null hoga to 'p' pair return krega jisme true,0 pda hai. to left me true,0 store hoga. likin pair left lohe to true kha store hoga bhaiya. someone clear this doubt of mine
@abhinowyt85642 жыл бұрын
Q.3 time complexity is O(N), int dfsHeight1 (TreeNode *root) { if (root == NULL) return 0; int leftHeight1 = dfsHeight1 (root -> left); if (leftHeight1 == -1) return -1; int rightHeight = dfsHeight1 (root -> right); if (rightHeight == -1) return -1; if (abs(leftHeight1 - rightHeight) > 1) return -1; return max (leftHeight1, rightHeight) + 1; } bool isBalanced(TreeNode *root) { return dfsHeight1 (root) != -1; }
@jaivardhanrajpurohit2703 ай бұрын
Easiest recursive approach without using pair(for sum of tree question) !!! int sumof(Node* root , int ans){ if(root->left == NULL && root->right==NULL){ return root->data; } int lefty = sumof(root->left , ans); int righty = sumof(root->right , ans); if((lefty+righty == root->data) && lefty!=NULL && righty!=NULL ){ return (lefty+righty+root->data); } } bool isSumTree(Node* root) { int ans = 0; int left = sumof(root->left , ans); int right = sumof(root->right , ans); if((left+right == root->data) && left!=NULL && right!=NULL){ return true; } else { return false; } }
@prashantbirajdar92712 жыл бұрын
u are so much dedicated towards your work...thats the thing which is most special in you broo...hatts of to you..keep it up..
waaaah kya baat hai bhaaiaya sab ekdum clear ho gya.. qstns clear op
@ritiksharma-im6dx2 жыл бұрын
Best course on KZbin ..thanks bhaia
@sakshiawadhiya72672 жыл бұрын
Bhaiya aapne itna achha logic kaise build kiya programming me
@Raj10185 Жыл бұрын
Short and simple logic and code for the MOst important question that is :- SUM TREE class Solution { public: bool flag = true; int issum(Node* root) { if(root == NULL) return 0; int ls = issum(root->left); int rs = issum(root->right); if((root->left or root->right )&& root->data != ls + rs) { flag = false; } return root->data + ls + rs; } bool isSumTree(Node* root) { if(!root) return true; issum(root); return flag; }
@MohdUmer-k1j Жыл бұрын
Great Bhaiya your teaching style is very amzaing understandability++
@sasankakundu52158 ай бұрын
Totally guided content and explanation, love and respect Babbar bhaiya ❤
@anisingh08849 ай бұрын
at this question i properly get the concept of recursion working .Thanks a lot bhaiya
@vmstudy99657 ай бұрын
Ap shi bole bhai
@GauravHaritas Жыл бұрын
14:08 Waahh Kya baat h kya baat hai 👏🙌
@ravivishvas36762 жыл бұрын
Got the concept in depth and very clearly Thanks🥳🥳
@ekestaakehrgi Жыл бұрын
In balanced tree question calling Boolean function and returning true is somewhat not required to solve the question, instead just check the height of the tree difference as class Solution { public: int height(TreeNode*& root,int& balanced){ if(!root || balanced==0) return 0; int left=height(root->left,balanced); int right=height(root->right,balanced); if(abs(left-right)>=2) balanced=0; return max(left,right)+1; } bool isBalanced(TreeNode* root) { //initially I assume that tree is balanced, therefore balanced is true. int balanced=1; height(root,balanced); return balanced; } };
@mukulsingh7530 Жыл бұрын
waah kya baat h for the first question as u said to do so.....
@pranavthakur74712 жыл бұрын
consistency to op hai bhaiya.....ji love youuuu
@PrathameshSwami-v6p Жыл бұрын
Waah Kya Baat Kya Baat.... Understanding++
@DoubleL_Leo Жыл бұрын
You're doing great work. Please keep doing it thank you bhaiya
@roshangupta629 Жыл бұрын
bhaiya paid course aapka lenhi paya but aapka video ke saath aapke promotion ka time bhi pura dekhta hu😇😇
@preetham3610 ай бұрын
difficult topic , u make it seem easy , need time to process recursion by dry run🔥🔥🔥