Thank-You :) you guys are great! Sharddha didi's Explanation is just awesome! Thanks again
@abhijeetkumarjha81373 жыл бұрын
I had no confidence in coding when I had begun this course and also hated coding , it was like a burden to me. But now after almost a month I have reached a level where I only want to code . All thanks to this amazing playlist by Apna College channel.
@rahuldasari18863 жыл бұрын
+1
@neerajkumarsingh47213 жыл бұрын
The Hardest part is yet to Come :)
@shivangbhardwaj31653 жыл бұрын
bro yo ufinished 97 videos in a month? how do you keep the consistency please help
@harshhcode3 жыл бұрын
@@shivangbhardwaj3165 same question !!!
@dehlanshandirkayr61822 жыл бұрын
@@shivangbhardwaj3165 3 videos a day :)
@vikasmane88513 жыл бұрын
i appreciate all hardwork of apna college Team Huge respect to you guys
@rahultripathi5913 жыл бұрын
bro do you know where can I have notes of lectures that are not in the description.
@melodytunes22043 жыл бұрын
@@rahultripathi591 bro agar pta chale toh mujhe bhi btadiyo
@arky19232 жыл бұрын
This is a quite optimized and straightforward approach if anyone needs it void Level_order(node* root){ if(root==NULL){ return; } queue q; q.push(root); while(!q.empty()){ node* temp = q.front(); cout data left)q.push(temp->left); if(temp->right)q.push(temp->right); } } // call by Level_order(struct node* root);
@vivek_1300 Жыл бұрын
wonderfull explanation didi
@shubhamkumar9313 Жыл бұрын
Awesome, I have been watching lot of other YT videos, not able to understand. But this pictorial presentation is really helpful.
@SaurabhKumar-tm4er3 жыл бұрын
Nice way to understand all of us didi thanks
@girishporwal51833 жыл бұрын
Didi u are the best. Ty Team AC
@vidhanpatni8338 Жыл бұрын
2:25 you can hear the cooker whistling here lol;
@dhruvsakariya31292 жыл бұрын
Thank You this is very intuitive approach
@amanrathore3610 Жыл бұрын
Very nice exxplaination and video editing,tqs shradha di
@sanyazaveri45112 жыл бұрын
Very nicely explained. Thank you!
@BECRIZWANkhan2 жыл бұрын
Great work by apna college
@dhruvarora8136 Жыл бұрын
best explanation ever. thanks to those animations
@anishsingh9043 Жыл бұрын
If someone is confused. Most basic approach. You just optimize as you want. Just to explain what she did in an elaborated way. while(!q.empty()){ while(q.front() != NULL){ Node* node = q.front(); coutleft); } if(node->right){ q.push(node->right); } q.pop(); } q.pop(); if(!q.empty()){ q.push(NULL); level++; } } cout
@chinnu9772 Жыл бұрын
Concept and explanation into deep, tq!!
@Kaushik846 Жыл бұрын
Superlike very nice explanation
@yashchampaneri19723 жыл бұрын
Pls provide Notes of all lecture which is not provided till yet!
@RajanGupta-fj8fi2 жыл бұрын
Didi you are great
@murapovyerkhan24392 жыл бұрын
Thanks brothers
@harsh.84363 жыл бұрын
It was a great class!!!! Can we access notes of this lecture?
@santoshbhupati35793 жыл бұрын
thank you so much
@MindMunchies.2 жыл бұрын
thank u dii
@shikhamaurya44533 жыл бұрын
All I can do is not skipping the Ads and say "Dhanyawaad" to apna college team.😊
@anirudhrajebhosle42862 жыл бұрын
Aman bhaiya nai apna channel monetize nahi kiya hai. Ad dekho yha na dekho usse Aman bhaiya ko koi farak nahi padega.
@RAMANKUMARGCEBIT2 жыл бұрын
very helpful
@sudipc98803 жыл бұрын
Thanks
@raaz78412 жыл бұрын
if we need sum of kth level only then why we traversing to the last node , we can traverse only up to kth level then break out, there is chance of improvement in this code, please look into this.
@768_sakshisharma93 жыл бұрын
please make more videos as such
@HimanshuSingh-zu4ht3 жыл бұрын
better solution for sum at kth level (just for different approach) void sum(node* root,int k,int* ans){ if(root == NULL){ return; } if(k == 1){ *ans += root->data; } sum(root->left,k-1,ans); sum(root->right,k-1,ans); } int main(){ node* root = new node(1); root->left = new node(2); root->right = new node(3); root->left->right = new node(5); root->left->left = new node(4); root->right->right = new node(7); root->right->left = new node(6); int ans = 0; sum(root,1,&ans); cout
@abhishek.rathore3 жыл бұрын
Can't say its better as recursive solutions are generally slower than iterative ones.
@aryanagarwal20713 жыл бұрын
@@abhishek.rathore BFS vs DFS u cant say which one is better
@chickmagnet20673 жыл бұрын
@Himanshu Singh agreed.
@pk42883 жыл бұрын
there will be k+1 in one of the sum(....)
@PradeepSingh-tq7kg3 жыл бұрын
listen vro k==1 vaali loop me return laga de acha rahega varna k negative hota jaayega until last level jo kisi kaam ka nahi hai................
@hassankhan26982 жыл бұрын
Use an optimised approach no need to insert null at the beginning not the the end of while loop. Simple use while loop until the queue is empty.
What is the significance of int 32_t main(), Someone pls explain
@PradeepSingh-tq7kg3 жыл бұрын
@@mr.darkheart2979 yes
@PradeepSingh-tq7kg3 жыл бұрын
simple int can be 16 or 32 bit which depends on compiler to compiler but int32_t is always of 32 bits and there is one more type int_fast32_t this serves as the name hints
@niazi742 жыл бұрын
Notes of Level order traversal????
@saurabhshandilay82613 жыл бұрын
Bhai moj kar di
@alveenamasub84993 жыл бұрын
Million dollar content
@raaz78412 жыл бұрын
notes link?
@MaheshPatil-of1zy Жыл бұрын
Why this problem cant solved using recursion?
@ogbuddha78353 жыл бұрын
Queue declare krne pe error aa rha h
@pradeepasktkar43303 жыл бұрын
😊😊
@vaibhavsharma45003 жыл бұрын
Thank you 🙏🙏
@ayush_b_593 жыл бұрын
Can anyone tell me "apna college" channel is giving course of full stack developer? Please
@sleepypanda71723 жыл бұрын
try to ask on his mail. & ya be formal and nice to get a quick reply. CHEERS
@tanmaiysethiajain43673 жыл бұрын
gfg with animation
@gauravkulkarni69253 жыл бұрын
Does anyone know Why are we writing queue Q; What does Node* mean and whats the difference in queue *q …..in short I want to ask * bracket ke Andar Q ha ?.?
Why are we writing queue Q; What does Node* mean and whats the difference in queue *q …..in short I want to ask * bracket ke Andar Q ha ?.?
@sachinbairi63533 жыл бұрын
@@gauravkulkarni6925 bro humko ek queue chahiye to store the pointer to our tree Nodes thats why we are doing queue q and not queue *q
@palashpadiya27923 жыл бұрын
My queue is not working
@loser00233 жыл бұрын
@@gauravkulkarni6925 bhai basically queue is a container hence we need to specify what are we storing i to , for example say , maybe int or string , here we have defined our own structure node* , which species its clas , hence we specify it using queue same as we do in the case of queue
@shadowmonarch31552 жыл бұрын
can you tell why we use Node*curr=q.front();
@SubhamKumar-fr7gw3 жыл бұрын
har video me poora bhar bhar ke paikhana kar deta hai
@RohitSingh-se6ch3 жыл бұрын
guys lne 26 q.pop() kyu kiya
@pushprajsinghjadoun22293 жыл бұрын
kyu ke jo value print kar de hai vo value queue se hatane padhe ge
@nitishsingh34703 жыл бұрын
Amazing
@harpic9493 жыл бұрын
Ma panner khaunga
@palashagrawal23433 жыл бұрын
y used NULL concept at first to make it more complicated? We can just simply avoid that NULL to traverse
@revanth64763 жыл бұрын
to just make you understand different problems on traversal. it will help you @palash Agrawal
@thunderstrm40283 жыл бұрын
it will help you in to find the left view and right view of the binary tree
@darshanpagar18943 жыл бұрын
can you please give code for sum at kth level without using null
@ronakgarg75693 жыл бұрын
Didi aapne dimaag khol diaa
@Pragma_Solidity3 жыл бұрын
why are we using NULL in order traversal? i mean code runs same without pushing NULL
@gauravupreti93403 жыл бұрын
Yeah, no need for NULL in this, they did it so that if you want to print binary tree line by line, then you can use NULL to do that.
@PradeepSingh-tq7kg3 жыл бұрын
if u want to keep track which level u reached
@Funprince14113 жыл бұрын
Good evening mam..
@srizwan789 Жыл бұрын
abhi thak mam ne reply nahi diya apko....🙂🙂
@adityanarayanjaiswal8903 жыл бұрын
26000
@stylishstarrohan96163 жыл бұрын
mujhe 1 ande vala burger
@saurabhshandilay82613 жыл бұрын
Koi notes bhi upload kr do😭
@rutvikrana5123 жыл бұрын
In Level Order Traversal, If We Dont want to know nodes with level than simple use queue without using NULL at all. void levelOrder(Node* root){ queue Q; Q.push( root ); while( !Q.empty() ){ std::cout data left ) Q.push( Q.front() -> left ); if( Q.front() -> right ) Q.push( Q.front() -> right ); Q.pop(); } } In Second Question We Can Simply Do Recursive InOrder Traversal with Height ... void inOrder(Node* root, int height, int& K, int& answer){ if(height > K) return; if(root -> left) inOrder( root->left, height+1, K, answer ); if(height == K) answer+=root->data; if(root -> right) inOrder( root->right, height+1, K, answer); } int sumAtK(Node* root, int K){ int answer = 0; inOrder( root, 0, K, answer); return answer; }
@epic_amvs40953 жыл бұрын
Yes but then you will not be able to check the different levels
@gauravkulkarni69253 жыл бұрын
Why are we writing queue Q; What does Node* mean and whats the difference in queue *q …..in short I want to ask * bracket ke Andar Q ha ?.?
@epic_amvs40953 жыл бұрын
@@gauravkulkarni6925 * bracket ke andar isliye hai kyuki node pointer pass kar rahe hai template mai jaise int x likha hai to agr hame queue chaiye x ko store karne ke liye to ham banaynge queue usi prakar se node * x ko queue mai store karne ke liye banaynge queue kyuki template[ bracket ke andar jo likha hai usme ] mai hame data type pass karna hota hai aur x ka data type is case mai node * hai.
@AyushKumar-pe9wx2 жыл бұрын
The quene q; is not decalred showing while I am trying to run the code help me out please! @ApnaCollege