Yar views 3k aur likes sirf 200 itna quality content mil rha h free me, ab kya chahiye bhai log? Har kisi ne laptop me pdha diya h sare courses me lekin sirf rohit bhaiya ne hi itna quality content ko board pe cover kr rhe hn, kitna efforts lgate hn, koi faltu bkwas nhi koi promotion nhi na hi koi faltu ka excuse ki maine job aap logon ko pdhane k liye quit kr di, itna high quality content de rhe hn thoda support krne me kya dikkat h,plz bhai support kro yr plz humble request sbse 🙏🙏🙏
@RahulGupta-wv7lv3 ай бұрын
Bhai ye fake id rohit bhai ke he hai kya
@rasheedahmad56117 ай бұрын
your teaching style is just amazing. soon you will touch 1M subscriber.
@DelightfulTreeSwing-qo6tm9 ай бұрын
Bhaiya maine 4 problems khud se solve kiya tha except for spiral transversal ….. bhaiya apke videos se mujhe bhut kuch sikhne ko mila hai … dry run and thinking process … thanks for teaching us .
@nidhiraj96869 ай бұрын
Bhaiya 2 question khud se hue. Boht acha lecture tha ye. Boht kuch sikhne ko mila ❤❤
@Aniruddha_Mukherjee9 ай бұрын
Bhaiya 1 problem khudse solve kar liya tha , aur 2nd problem ka algo khud se soch liya tha lekin code nhi ho paya. Aaj ke lecture se bohot kuch seekha , aur logic building bhi improve ho raha hain. 😊
@neelmishra53049 ай бұрын
51:34 ans- if(valid) conditional statement was written before so that whenever the valid becomes zero we dont need to traverse the whole tree and it return from the node where valid becomes zero.
@akashkewat12199 ай бұрын
Aaj Leetcode POTD mei bhi same question tha bhaiya. Code kafi accche hai tree ke.
@chanchalsoni75355 ай бұрын
highly underrated channel😐 why dont people like the videos....i feel so bad .....
@fachoyt96865 ай бұрын
I feel so much more confident in Binary Tree after watching your videos. Thanks for being such a great resource!
@zafrul_islam9 ай бұрын
bhaiya khud se ek bhi problem solve nhi hui but maja aaya sikh kr 😊😊
@rrr98488 ай бұрын
Congratulations bhaiya 🎉
@asad_iliyas7 ай бұрын
51:00 : if(valid==0) => It means unbalanced node is found and we will directly come out of function by returning -1 , and our valid would have become 0 and we will return it in our main function.
@kamleshregar58804 ай бұрын
very good lectures. keep doing it for us. thank you bro for your hardwork
@heetpatel30376 ай бұрын
Aapka jitna shukriya da karu utna kam hai
@alltech_info2 ай бұрын
Shuru majboori me kiye the ab maja aa rha hai😇😂
@devendrasharma8750Ай бұрын
bhaiya did level order traversal in spiral by my self. thanku bhaiya❤🩹
@Noobiee_FPS9 ай бұрын
sab kuch kr liya bhaiya sare questions kr liya spiral wale code mai confuse ho gya tha par dry run kra toh sab smjh mai aa gya tha first three question approach ka idea lga liya tha bss code nhi kra tha dono question video dekh ke ek cheez smjha aaya tree ko traverse krna aana chaiye tabhi question hoge
@heetpatel30376 ай бұрын
Jai shree Ram ❤️ Bohot bohot dhanyawad aapka bhaiya
@Sanataniblood-mb5pu5 ай бұрын
Content outstanding and bhaiya is also outstanding 😂🙏🏻
@RohitKumar-gj2px4 ай бұрын
Thanku so much for best quality content . Your style of teaching is amazing and i am enjoying your videoes . LOVE YOU BROTHER ❤❤
@ankushladani4969 ай бұрын
Bhaiya Khali second wali if statement nahi kar paya Baki pura solution khudse implement kar liya tha...😊❤
@anupammishra65149 ай бұрын
1:44:54 maja aa gya bhaiya ❤❤......1 questions solve hua hamse 🥲🥲
@um68198 ай бұрын
UPDATED CODE if test case not passed in GFG for TC no. 1075 (see the previous line before the last line) everything will be same bool isParent(Node *root, int a, int b){ if(root==NULL) return 0; if(root->left && root->right){ if(root->left->data == a && root->right->data == b) return 1; if(root->left->data == b && root->right->data == a) return 1; } return (isParent(root->left, a, b) || isParent(root->right, a, b)); } bool isCousins(Node *root, int a, int b) { queue q; q.push(root); int level = 0; int l1 = -1, l2 = -1; while(!q.empty()){ int n = q.size(); while(n--){ Node* temp = q.front(); q.pop(); if(temp->data==a) l1 = level; if(temp->data==b) l2 = level; if(temp->left) q.push(temp->left); if(temp->right) q.push(temp->right); } level++; if(l1!=l2) return 0; if(l1!=-1) break; } if(l1==-1 && l2==-1) return 0; //updated line, if a and b is not present anywhere in the tree return !isParent(root, a, b);
@CoderArmy98 ай бұрын
Good Job bhai, they have updated the TC.
@haardikmadaan16448 ай бұрын
thanks bro....i was so confused in this
@nownow102527 күн бұрын
it still fails t.c 219
@JatinKansal-z5b7 күн бұрын
Still not working plz help
@nownow102528 күн бұрын
Great explanation bhaiya. Thank you so much ♥
@ankushladani4969 ай бұрын
Sab kuch chamak gaya Bhaiya...❤🎉
@rishavdobriyal820118 күн бұрын
amazing explaination sir
@akashkumawat-xk1eg2 ай бұрын
Maza aa gaya❤❤ I solved all problems by myself😀😀
@Vardanaggarwal8 ай бұрын
thanks bhaiya amazing series leking ek bhi problem khud se nhi huyi.
@GOATSOFFOOTBALL4 ай бұрын
Thodasa brainstorming tha session but loved it,best explanation
@amanprajapati63018 ай бұрын
thank u bhaiya for providing quality content dil se
@sunnyrai43299 ай бұрын
Congratulations❤ almost 3 que solved by self
@AnordinaryMan0079 ай бұрын
Best course ❤
@Md.FarhanMasud-u8x2 ай бұрын
// Spiral Print Binary tree using deque vector findSpiral(Node *root) { int n; vector ans; deque q; q.push_back(root); while (q.size()) { // print Right to left & Reverse left to right n = q.size(); while (n--) { Node *temp = q.back(); q.pop_back(); ans.push_back(temp->data); if (temp->right) q.push_front(temp->right); if (temp->left) q.push_front(temp->left); } // Print left to right and Reverse right to left n = q.size(); while (n--) { Node *temp = q.front(); q.pop_front(); ans.push_back(temp->data); if (temp->left) q.push_back(temp->left); if (temp->right) q.push_back(temp->right); } } return ans; }
@rishusachan26184 ай бұрын
Thanku Bhaiya, ekdum accha say chmak gya 😍😇
@ayushpanwar16713 ай бұрын
bhaiya sab samaj agya... one day you will be recognized
@rocketgamerzz.75775 ай бұрын
Problem 4 can be done using a single deque instead of two stacks for odd level push at back and take from front and for even level vice versa here's the code for your reference deque q; q.push_back(root); vector ans; while(!q.empty()) { int n = q.size(); while(n--) { //odd level k liye Node *temp = q.back(); q.pop_back(); ans.push_back(temp->data); if(temp->right) { q.push_front(temp->right); } if(temp->left) { q.push_front(temp->left); } } n = q.size(); // even level k liye while(n--) { Node *temp=q.front(); ans.push_back(temp->data); q.pop_front(); if(temp->left) { q.push_back(temp->left); } if(temp->right) { q.push_back(temp->right); } } }
iss tarike se likhna hoga code aage khain bhi? like exam intreview
@amybross4 ай бұрын
thank you brother for your great effort
@5harshitshrivastava4 ай бұрын
superb quality content🙌
@Eng_wallah9 ай бұрын
Radhe Radhe bhaiya 🙏🏻🙏🏻
@neetuchaudhary78847 ай бұрын
thannnkkkkk youuuuuuu so much bhaiya🤗🤗
@ujjwal_75315 ай бұрын
i did the level order traversal in spiral question using queue vector findSpiral(Node *root) { //Your code here queueq; vectorans; q.push(root); int rand=1; while(!q.empty()){ int size=q.size(); vectortem; for(int i=0;idata); if(temp->left) q.push(temp->left); if(temp->right) q.push(temp->right); } if(rand%2==1) for(int i=size-1;i>=0;--i) ans.push_back(tem[i]); else for(int i=0;i
@vijaysingh-n6p9jАй бұрын
Bahut badiya tha bhaiya
@study-yd6es5 ай бұрын
Amazing Videos keep it up brother
@Harshmishra00078 ай бұрын
Last question Two Nodes are cousin int level(Node *root,int i,int a){ if(root==NULL) return 0; if(root->data==a){ return i; } return max(level(root->left,i+1,a),level(root->right,i+1,a)); } bool f(Node * root,int a,int b,int m,int i){ if(root==NULL) return true; if(root->left && root->right){ if(root->left->data==a && root->right->data==b) return false; else if(root->left->data==b && root->right->data==a) return false; } if(i==m) return true; return (f(root->left,a,b,m,i+1) && f(root->right,a,b,m,i+1)); } bool isCousins(Node *root, int a, int b) { if(!root->left && !root->right) return false; int m=level(root,0,a); int n=level(root,0,b); if(m!=n) return false; else return f(root,a,b,n,0); }
@soumyadeepghosh44285 ай бұрын
// Approach 2 for Problem - 3 (Balanced Binary Tree) class Solution{ public: int height(Node* root) { if(!root) return 0; int leftHeight = height(root->left); int rightHeight = height(root->right); return 1 + max(leftHeight, rightHeight); } bool isBalanced(Node *root) { if(!root) return 1; if(abs(height(root->left)-height(root->right)) > 1) return 0; return isBalanced(root->left) and isBalanced(root->right); } };
@xlr8-Ujjwal3 ай бұрын
For those whose program is not passing after test case 1075. Simply add the below line to resolve the edge case ⬇⬇⬇⬇⬇⬇⬇⬇⬇⬇ if(!root ->left && !root ->right) return 0;
@dipakmali98177 ай бұрын
Day 154/180 ✅
@Aniruddha_Mukherjee9 ай бұрын
Good morning Bhaiya ji😍
@vaishnavigoswami57075 ай бұрын
problem 5: to find level of a and b using recursion h =0; and l1=-1;l2=-1;intially void level(Node* root,int a,int b,int h,int&l1,int&l2) { if(root==NULL) return; h++; if(root->left) { if(root->left->data==a) l1=h; if(root->left->data==b) l2 =h; } if(root->right) { if(root->right->data==a) l1=h; if(root->right->data==b) l2 =h; } level(root->left,a,b,h+1,l1,l2); level(root->right,a,b,h+1,l1,l2); }
@ChandanKumar-kt8ku5 ай бұрын
Congratulations
@YashSaini0079 ай бұрын
Bhaiya Radhe Radhe 🙏
@pankajdubey11238 ай бұрын
Level order Traversal in spiral form : vector findSpiral(Node *root) { //Your code here deque dq; dq.push_back(root); vector ans; int flag=0; int n; Node *temp; while(!dq.empty()) { if(flag%2==0) { n=dq.size(); while(n--) { temp=dq.back(); dq.pop_back(); ans.push_back(temp->data); if(temp->right) dq.push_front(temp->right); if(temp->left) dq.push_front(temp->left); } } else { n=dq.size(); while(n--) { temp=dq.front(); dq.pop_front(); ans.push_back(temp->data); if(temp->left) dq.push_back(temp->left); if(temp->right) dq.push_back(temp->right); } } flag++; } return ans; }
@vivektechtuber2049 ай бұрын
Good Morning Bhaiya 🙏
@ankushladani4969 ай бұрын
Thanks bhaiya...❤🎉
@mohit62159 ай бұрын
100k laga do bahiyo
@SanatanaDharmaDaivagnya9 ай бұрын
jai ho bhaiyya
@JayPrajapati-lj8pw9 ай бұрын
Best content😊😊❤
@aahilkhan42809 ай бұрын
2 questions khud se kr liye bhaiyya ,remaining 3 problems ka algo bhi likh liya tha ,but implement nhi kr paya.
@aadityakumarjha-ju3xg9 ай бұрын
Good morning bhaiya
@punitsharma5844 ай бұрын
me in this last question when level came in my mind be like ::level sabke niklenge pr niklenge uske jo khada rhega
@deep_singh019 ай бұрын
Day 154/180 👍👍
@asad_iliyas7 ай бұрын
4/5 solved
@itshirdeshk9 ай бұрын
Day 154 ✅🔥
@allinonemoviesyt9 ай бұрын
1:44:14 Homework bool parents(Node *root, int a, int b){ if(!root) return false; if(root->left && root->right){ if(root->left->data == a && root->right->data == b){ return true; } if(root->left->data == b && root->right->data == a){ return true; } } return parents(root->left,a,b) || parents(root->right,a,b); } void findLevel(Node *root, int a, int b, int level, int &l1 , int&l2){ if(!root){ return; } if(root->left){ if(root->left->data == a){ l1 = level+1; } if(root->left->data == b){ l2 = level+1; } } if(root->right){ if(root->right->data == a){ l1 = level+1; } if(root->right->data == b){ l2 = level+1; } } if(l1 == -1 || l2 == -1) findLevel(root->left,a,b,level+1,l1,l2); if(l1 == -1 || l2 == -1) findLevel(root->right,a,b,level+1,l1,l2); } bool isCousins(Node *root, int a, int b) { int l1 = -1, l2 = -1; findLevel(root,a,b,1,l1,l2); if(l1 != l2) return false; if(parents(root,a,b)){ return false; } return true; }
@utkarshpandey13944 ай бұрын
nice
@PrathamSinghhAirАй бұрын
51:58 pe sir ka " dum dum dum dum " 😂
@vijaysingh-n6p9jАй бұрын
bhaiya last vala question bahut hard tha
@ankitchoudhary29149 ай бұрын
Chill scene❤❤❤
@pradeepraghu1see9 ай бұрын
till end .
@YASHYADAV-f9i2 ай бұрын
bhaiya maja aagya
@akshaythakur42314 ай бұрын
Wow ❤
@fakharabbas97388 ай бұрын
Love U Coder Army❤
@YashSaini0079 ай бұрын
Day 154/180 #180DaysOfCode
@abhishekgupta77099 ай бұрын
Bhaiya chamka. One request put the Coder army DSA sheet on its website .
@Abhishekkumar-gr5vr9 ай бұрын
🔥🔥
@ankitshrestha6481Ай бұрын
// Time O(N) and Space O(N) // Another approach bool isNodes_areCousin(Node* root, int first, int second) { queue list; list.push(root); list.push(nullptr); int currentLevel = 0; int firstLevel = 0; int secondLevel = 0; int parent1 = -1; int parent2 = -1; Node* temp; while (!list.empty()) { temp = list.front(); list.pop(); if (temp == nullptr) { if (list.size() == 0) break; currentLevel++; list.push(nullptr); } else { if (temp->left) { if (temp->left->data == first) { parent1 = temp->data; firstLevel = currentLevel + 1; } if (temp->left->data == second) { parent2 = temp->data; secondLevel = currentLevel + 1; } list.push(temp->left); } if (temp->right) { if (temp->right->data == first) { parent1 = temp->data; firstLevel = currentLevel + 1; } if (temp->right->data == second) { parent2 = temp->data; secondLevel = currentLevel + 1; } list.push(temp->right); } } } return (parent1 != parent2) && (firstLevel == secondLevel); }
@kuldeepparmar98618 ай бұрын
chamak gaya last tk
@hiteshsharma50348 ай бұрын
Bhaiya, Here is my code for Vertical Traversal using pair vector concept, sorting and recursion... class Solution { public: void find(TreeNode* root, int pos, int level, vector &v){ if(root==NULL){ return; } v.push_back(make_pair(pos, make_pair(level, root->val))); find(root->left,pos-1, level+1,v); find(root->right, pos+1, level+1,v); } vector verticalTraversal(TreeNode* root) { vector v; vector ans; if(root==NULL){ return ans; } find(root,0,0,v); sort(v.begin(),v.end()); int prev=v[0].first; vector temp; for(auto x: v){ if(x.first==prev){ temp.push_back(x.second.second); } else{ prev=x.first; ans.push_back(temp); temp.clear(); temp.push_back(x.second.second); } } ans.push_back(temp); return ans; } };
@amorphous88264 ай бұрын
👍
@Aryan-wl7mc9 ай бұрын
0:28 Google mai job pakki hai jisne like kiya 😂😂😂
@yashpaunikar6718 ай бұрын
bhaiya leetcode ke bhi link attach kr dijiye
@meetdobariya87773 ай бұрын
same code likha cousin ka lekin 1075 pe differnce a raha he
@xlr8-Ujjwal3 ай бұрын
Add this line if(!root ->left && !root ->right) return 0;
@fakharabbas97388 ай бұрын
Love U Coder Army
@IR200253 ай бұрын
Lec - 104
@pranavmittal96199 ай бұрын
2/5 questions ho gaye lekin vo bhi pehle kar rakhe the
@swarupdwivedy57339 ай бұрын
How to prepare DSA with GATE?
@ankitchoudhary29149 ай бұрын
done todays classs
@vishnusingh23008 ай бұрын
29:00
@rishuagarwal1523Ай бұрын
leet code 5th number question testcase 1075 is giving wrong output with same code can anybody help
@farhansadik72363 ай бұрын
in the spiral traversal i got TLE in leetcode,i cannot figure it out . anyone ?
@letsk91886 ай бұрын
i reach to last
@gateavi9 ай бұрын
#1
@ShaikSharmaАй бұрын
sir,i have my google interview can i crack if i watch all of your playlist
@anupammishra65149 ай бұрын
❤❤
@vivek71879 ай бұрын
🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
@vishnusingh23008 ай бұрын
51.21
@prashantsingh34742 ай бұрын
Level order traversal in spiral form solution of this question using deque... vector findSpiral(Node *root) { dequeq; vectorans; int count=0; q.push_back(root); while(q.empty()!=1){ int qsize=q.size(); for(int i=0;idata); if(temp->right!=NULL){ q.push_front(temp->right); } if(temp->left!=NULL){ q.push_front(temp->left); } } else{ //if count is odd means in tree we move right to left Node* temp=q.front(); q.pop_front(); ans.push_back(temp->data); if(temp->left!=NULL){ q.push_back(temp->left); } if(temp->right!=NULL){ q.push_back(temp->right); } } } count++; } return ans; } If any anyone like my solution then plz like my comment...