You are the best teacher with a perfect tone of gifted voice and providing clear explanations about what is happening in memory. These fundamentals would be stamped into our memory easily. Please keep up the great job extending videos to new topics.
@slayerq3
9 жыл бұрын
You are doing god's work, seriously...This is the only place I've learned sorting algorithms, trees, linked lists, everything related to my syllabus. I should be paying you instead of my college :P
@AlexanderMcNulty92
7 жыл бұрын
Sad but true. His code is so much cleaner than anything in the books.
@nikhilbalwani2285
6 жыл бұрын
LOL. Donate generously to mycodeschool.
@vincentlavello3499
4 жыл бұрын
I totally agree. Thanks for this. I will be donating - wish I could get my tuition refunded and donate it here.
@adityaojha2701
4 жыл бұрын
Man even 4 years later this is the best playlist on DS.
@abdelrhmanahmed1378
3 жыл бұрын
@@adityaojha2701 true its the best in the entire world wide web and even among university prof
@ritikpatel3286
5 жыл бұрын
One of the best explanation's out there!
@mursalinhabib1156
4 жыл бұрын
These guys are crazy amazing, You guys deserve a Turin prize!
@anirvansen2941
4 жыл бұрын
Python Implementation: def level_order_traversal(self): if not self.root: return -1 else: queue = [] queue.append(self.root) while len(queue) != 0: popped = queue.pop(0) print(popped.data,end=" ") if popped.left: queue.append(popped.left) if popped.right: queue.append(popped.right)
@rohithm
9 жыл бұрын
awesome explanation.....!
@eyalpery8470
6 жыл бұрын
Great video!!!
@piotrwiniarski
7 жыл бұрын
Is level order traversal same as Breath-first traversal ? I am little confused.
@95SUJITH
7 жыл бұрын
Yes it is.
@mycodeschool
10 жыл бұрын
Next Lesson: - Binary tree traversal: Preorder, Inorder, Postorder
@rohit2761
8 жыл бұрын
+mycodeschool okay babu
@amateurbeginner7538
7 жыл бұрын
GOD bless you , you are the best teacher i have ever seen :) great attitude, clear explanation and organized material :)
@mycodeschool
10 жыл бұрын
Poyo Boy - A pointer variable always stores an address. For the definition of Node in this lesson, if I have a pointer to current node in a variable named current, then current will give me the address of that node ,,, current->left will give me address of left child and current->right will give me address of right child. Did you watch previous lessons on tree in this series? They should make things clear for you. Data structures: Introduction to Trees
@truongvanloc8275
10 жыл бұрын
Do we use stack for other binary tree traversal algorithm: PreOder,InOder,PostOder?
yes bro we are using stack(implicitly) .but ,it takes place in application memory stack
@jonathanlim2269
9 жыл бұрын
I've grown to be a fan of your videos - they're my first stop for any question or concept I need to clarify on programming!
@mycodeschool
9 жыл бұрын
Jonathan Lim Thanks a lot :)
@amateurbeginner7538
7 жыл бұрын
why do we need current in this example ? :)
@schizophrenicleo3036
4 жыл бұрын
@@mycodeschool Have you guys moved somewhere? Where is the website? There are not new videos from the past three years as well :(
@sravanthkumarchintalacheru1359
4 жыл бұрын
@@schizophrenicleo3036 From the comment sections and the news, I learned that the creator of this channel died in a road accident :( He's famous in programming community as Humble Fool
@schizophrenicleo3036
4 жыл бұрын
@@sravanthkumarchintalacheru1359 Oh , I am sorry. Didn't know that. He was indeed making wonderful videos though.
man, I have a PhD in CS, your work is outstanding, it's a great effort to make things clear and accessible to anyone
@betrp
4 жыл бұрын
BTW why are you watching this
@BharathKumarSampath
4 жыл бұрын
😂 curious to know
@mohandas3212
3 жыл бұрын
@@betrp 😂💯
@DangThinh261
3 жыл бұрын
Add friend me 🥲
@jackmiller2518
2 жыл бұрын
just had to tell us about your PhD didnt you
@chia-juchen8246
6 жыл бұрын
I remember watching your video in linked list for my data structure assignment as a freshman, now I am already studying CS master in the US and start watching your video again for preparing coding interviews! Sir, you're awesome! very clear explanation and easy to follow!
@tweede5555
3 жыл бұрын
6 years later, and this still helped understand. Concepts are truly timeless!
@seabass7615
3 ай бұрын
10 years for me now lol
@jervx829
13 күн бұрын
@@seabass7615 how many experience do you have in dev? Me just graduated, but still going back here because too much learning frameworks kinda forgot how this work lmao
@seabass7615
11 күн бұрын
@@jervx829 Im a sophomore in college for CS right now. I just meant that this 10 year old video still really helped me.
@serenestrolls-d7b
8 жыл бұрын
You got a really thorough knowledge, and you are getting way low audience than you deserve. i m trying to tell most of my friends to refer to your channel.
@11m0
7 жыл бұрын
Seriously, do you have a patreon or a donation link. I want to show my appreciation for what you've done for me by posting these videos
@kyssl
6 жыл бұрын
Victor Oben he's at Google/Microsoft now
@theFifthMountain123
5 жыл бұрын
Disable adBlocks for his videos and if possible click on advertiser links.
@JackSparrow-bx8oo
4 жыл бұрын
He died in road accident
@anveshreddypinnapareddy3552
3 жыл бұрын
@@JackSparrow-bx8oo Nah, that's not him. His friend, co-founder of mycodeschool died in a road accident.
@parthshah6343
4 жыл бұрын
Why are we doing queue instead of just queue can anyone please explain?
@looppp
9 жыл бұрын
mycodeschool is the best.
@DurgaGuntoju
9 жыл бұрын
Nice Explanation. You should explain the Tricky Part here. Output should be level wise. Means, E DJ BEGK ACI H
@eddyateye810
2 жыл бұрын
wow, this guy is huge with explanation... keep it up. have been looking for explanation for this but I think i discovered more than i wanted... bless you guy
@nesliemmanunday3682
Жыл бұрын
I was here from TOP
@soumyajitdey5720
5 жыл бұрын
IMPLEMENTATION IN C : #include #include #define MAX_SIZE 20 // BST IMPLEMENTATION struct BSTNode{ int data; struct BSTNode* left; struct BSTNode* right; }; struct BSTNode* Insert(struct BSTNode* root,int x) { struct BSTNode* temp = (struct BSTNode*)malloc(sizeof(struct BSTNode)); temp -> data = x; temp -> left = NULL; temp -> right = NULL; if(root == NULL){ return temp; } if(x data) root -> left = Insert(root -> left, x); else root -> right = Insert(root -> right, x); } // QUEUE IMPLEMENTATION struct BSTNode* queue[MAX_SIZE]; int front = -1; int rear = -1; int isEmpty() { if((front == -1) && (rear == -1)) return 1; else return 0; } int isFull() { if((rear + 1) % MAX_SIZE == front) return 1; else return 0; } void Enqueue(struct BSTNode* value) { // When the Queue is empty if(isEmpty()) front = rear = 0; // When the Queue is Full else if(isFull()) return; else rear = (rear + 1) % MAX_SIZE; queue[rear] = value; } struct BSTNode* Dequeue() { struct BSTNode* value; // When the queue is empty if(isEmpty()) return -1; // Queue consists of only 1 element else if(front == rear){ value = queue[front]; front = rear = -1; return value; } else{ value = queue[front]; front = (front + 1) % MAX_SIZE; return value; } } struct BSTNode* peek() { if(isEmpty()) return -1; else return queue[front]; } void printQueue() { printf("Queue is: "); for(int i=front;i data); if(current -> left != NULL) Enqueue(current -> left); if(current -> right != NULL) Enqueue(current -> right); temp = Dequeue(); } } int main() { struct BSTNode* root = NULL; root = Insert(root, 20); root = Insert(root, 10); root = Insert(root, 30); root = Insert(root, 5); root = Insert(root, 15); root = Insert(root, 25); root = Insert(root, 35); LevelOrderTraversal(root); return 0; }
@nitinjaiman
10 жыл бұрын
dude you are really good in teaching. i went through almost all your videos now i feel really confident in these topics
@sr3281
9 жыл бұрын
I always check your videos for a quick, concise and clear explanation of anything I want to learn. Your channels the channel I check for first when I search youtube for tech videos. Thank you very much
@MCrown
5 жыл бұрын
You are the best! Thanks for so clear explanation
@ajaygunalan1995
10 ай бұрын
9 years later, this is still, gold!
@Contemelia
3 жыл бұрын
My prof took 53 minutes. You took 38 seconds. Thanks a lot man :)
@AwaraGhumakkad
2 жыл бұрын
Amazing way of explaining :)
@Srinivasssssss
9 ай бұрын
This video is almost 9 years ago, but still this video it is the best explaination for level order traversal...(for me) Thank you so much sir...
@ashishkumarg5
9 жыл бұрын
Kudos ! Your video lectures are precise & lucid. Really helpful. Thanks a lot. (: thumbs up :) Could you please share videos on various algorithms implementing various design paradigm viz. Greedy, Divide & Conquer, Dynamic programming.
@jcvandermerwe5311
3 жыл бұрын
I work in C# and this is the first time that I got a clear understanding about Level_Order_Traversing. Brilliant work.
@madanmohan5661
2 жыл бұрын
How the Fu*k should I print this, I understand all things that is taught in this video but I don't know how it will print the elements
@lanternarasu6061
Жыл бұрын
@@madanmohan5661 Don't use curse words in educational videos
@rbsupercool
10 жыл бұрын
thank you very much again.. mycodeschool rocks.. i'm your biggest fan.. :)
@sunnysidesounds
9 жыл бұрын
Excellent, this was extremely helpful to visually see the level order traversal. I have been having trouble with other examples visually seeing what was happening and this cleared it up greatly. Thank you!
@DMDRPBHU
4 жыл бұрын
i rarely comment but you are a legendddddddddddd
@nishantaggarwal5627
10 жыл бұрын
can u provide me link to your next tutorial of implementation of postorder, preorder, inorder
@mycodeschool
10 жыл бұрын
Hey Nishant, I am yet to publish the next one. I took a break for a month for travelling :)
@truongvanloc8275
10 жыл бұрын
mycodeschool hope you soon release them! Thank you :) !
@harshhc5685
6 жыл бұрын
Why n/2 nodes at deepest sublevel
@jeetsharma1292
3 жыл бұрын
Awesome ...simple and yet so advanced!
@ardhyakumar2539
6 жыл бұрын
I bet, anyone cannot find better teaching elsewhere, whether be it paid course or at university :), I am rarely a fan of someone but I've been your and your channel's fan for quite a long time :)
@ashutoshdwivedi3976
5 жыл бұрын
Am i the only one who thinks at deepest level we would have (N+1)/2 nodes at deepest level, instead of N/2 ?
@someshchoudhary1946
5 жыл бұрын
you're correct it must be (n+1)/2
@josnoordzij6802
4 жыл бұрын
This helped me tremendously. Thank you very much. Great work!
@adityaojha2701
3 жыл бұрын
Thanks a lot SIR!!!♥
@TangiralaVenkat
9 жыл бұрын
Your videos are great sir it clearly explains what is there and helped me a lot Thank you sir Thank you very much
@berna031
2 жыл бұрын
thank you for your help
@zilla2854
5 жыл бұрын
how can i insert elements into tree in level order? i can't find anything helpful online.
@mpkp4369
5 жыл бұрын
This might help: www.geeksforgeeks.org/insertion-in-a-binary-tree-in-level-order/
@joelgeorge3435
5 жыл бұрын
It follows the same code as traversal. The idea is to keep traversing the tree until you encounter the first empty slot. Then insert and break the while loop. In the code that he has written, just make a few changes: ............................................................................. if(current->left!= NULL) Q.push(current->left); else{ current->left = GetNewNode(data); break; } if(current->right!= NULL) Q.push(current->right); else{ current->right = GetNewNode(data); break; } .............................................................................. where 'data' is the new node that you're planning to insert. The rest of the code is the same. Hope this helps.
@zoumzoumzou
5 жыл бұрын
Great explanations ! it's sad to see that the website is offline :( hopefully you moved on to some other great stuff
@eshikagupta159
6 жыл бұрын
Sir how the no. of nodes at the deepest level of perfect binary tree is n/2 ??
@SmokinBear199
8 жыл бұрын
Great videos. Just one question: What's the difference between this video and the BFS portion of the next? So, what's the difference between Level order traversal and BFS?
@KrrishShukla
8 жыл бұрын
i had the same question, but i guess it's one and the same.
@saravanan925
6 жыл бұрын
both are same
@austinbvi
5 жыл бұрын
Can't thank you enough for this playlist!
@AlexanderMcNulty92
7 жыл бұрын
Your channel has officially earned my trust. I will recommend anyone interested in basic data structures to come here.
@DiamondDogGoPewPew
5 жыл бұрын
Truly ... Thank You. I love your visual , they always help me understand the concepts.Clear and understandable. Awesome!
Can you solve the word break problem? It's a good example for dynamic programming. oj.leetcode.com/problems/word-break-ii/
@AvantikaShukla-b3p
18 күн бұрын
Finally found the best explanation of level order traversal
@ElmountasserIbrahim
6 жыл бұрын
another method without the queue but i have a problem with printing the root void printLevelOrder(struct BSTNode* root) { if (root == NULL) { return; } if (root->left != NULL) { printf("%d ", root->left->data); } if (root->right != NULL) { printf("%d ", root->right->data); } printLevelOrder(root->left); printLevelOrder(root->right); }
@govindkothari7989
4 жыл бұрын
queue test; void levelorder() { test.push(root); while(!test.empty()) { struct node* temp = test.front(); cout info left) test.push(temp->left); if(temp->right) test.push(temp->right); test.pop(); } } // it will work fine
@jamisongriffith6308
3 жыл бұрын
Incredibly helpful! The theoretical lesson was excellent. The code walkthrough was hard to follow, but you did such a good job at teaching with diagrams that the walkthrough wasn't necessary.
@factwithhunny078
Жыл бұрын
True
@kautukraj
4 жыл бұрын
Very helpful!
@chaitanyakumar9229
3 жыл бұрын
well .... toy have to write the pop function before pushing any elements into a queue..... otherwise the just pushed root->right might be popped :)
@srichetaruj2590
8 жыл бұрын
Superb!! thanks for helping :)
@pranjalgupta9427
3 жыл бұрын
Nice 👍👏😊
@MegaPaloma1988
5 жыл бұрын
Thank for the high level quality of the content .. keep doing ;)
@TomLobato
7 жыл бұрын
great class! tks! in 10:35, the max num of nodes in the deepest level is (n+1)/2, not n/2. Just noticed because I`m using a fixed size queue, so I had to calculate the max.
@akshaypathange3582
6 жыл бұрын
Tom Lobato he said at least
@sparshbohra4135
4 жыл бұрын
Can someone post a C program for BFS? There is no stdl for queues in C. I wanna work out how to do this recursion by calling a written enqueue and dequeue function. Please reply to this comment if you have a solution
@vishnuvardhan9038
2 ай бұрын
💘💘❤❤❤❤❤
@kyzuno5066
10 ай бұрын
God damn it. You are so great at teaching, my tuition should have gone to you instead of my professor.
@simplymade7802
6 жыл бұрын
Sir your voice and accent and of course your teaching is amazing...frm where do uh belong sr??
@madanmohan5661
2 жыл бұрын
How the Fu*k should I print this, I understand all things that is taught in this video but I don't know how it will print the elements
@rony3044
4 жыл бұрын
why isnt q.pop(); after cout
@juhabach6371
3 жыл бұрын
please continue to make coding videos...plz plz plz
@jonathanharoun5247
3 жыл бұрын
This is actually mind blowing
@Qweertt-y4r
2 жыл бұрын
your explanation is on the next level man. but anyone who can help me with the java code of these.
@rforrana12
2 жыл бұрын
Sir, please a book for data structure or the book, you follow.
@MJ-zs5jv
11 ай бұрын
These videos are really great to mayhem the fear of non-linear DS.
@Bouryal.Y
Жыл бұрын
space complexity can be also ( 2^height )
@IRONHORSE799
10 жыл бұрын
Hey.. thanks man your videos helps me a lot… my bad luck that i didn't watch it before some months… are your using stack for DFS ? Like… for PREORDER.. if S is an object of stack.. print current->data if(current->left != NULL){ S.push(current->left) recursive call for (current->left) } if(current->right != NULL) { S.push(current->right) recursive call for (current->right) } S.pop();
@Cassandra81552
9 ай бұрын
The best explanation ever, thanks a lot!
@nidinsree8434
3 жыл бұрын
Is there any standard library for queues in C?
@HeyMr.OO7
Жыл бұрын
Legendary.. Simply Legendary 👍🏻
@syedmaazshah8760
3 жыл бұрын
Sir please recommend me a suitable c++ compiler.
@snehill7275
2 жыл бұрын
& here is your new folwr....concise and well explained. You're amazing! thankyou : )
@MaxSharpy
Жыл бұрын
Great video! Very usefull even after 9 years! Code explanation was so good, I had no problems in implementing it into JS and I dont even know any other programming language. Thank you Sir for your work!
@nigannayak2139
7 жыл бұрын
videos are really helpful...they helped me a lot....thankyou sir and keep sharing this...
@CautiousCrow
8 жыл бұрын
Concise and well explained. You're amazing!
@sureshmoida3004
3 жыл бұрын
what is the IDE you're using right now
@chakraoracledba6710
6 жыл бұрын
Seems, your compositor frustrated with good content of your videos and they might be paying some non-sense IT company for fake Thumb-Down and fake bad comments. Indeed, your are doing well. Keep it up.
@dallasdominguez2224
4 жыл бұрын
Love watching these videos. Theyre like little brain logic puzzles.
@fury2613
7 жыл бұрын
Probably the only Indian who makes such good videos on programming!
@ravikamble8142
4 жыл бұрын
howt to mange this code for user inputs
@elishaalibakhsh7393
3 жыл бұрын
You saved me one more time. Thanks
@honeyshihtzu9675
8 жыл бұрын
I refer ur videos for any doubts ... and seriously u guys should start planning to charge .... :)
@tarunmathur7797
4 жыл бұрын
8:22
@prats22
3 ай бұрын
Watching after 10 years
@26411bapul
7 жыл бұрын
This is called best and awesome way of teaching some one. You really deserve 1000 Million likes. :)
@sbond_0077
8 жыл бұрын
Thank you is a small word! Keep recording.
@mrtom-a-hawk6732
3 ай бұрын
This is a godsend thank you
@christopherramos2210
Жыл бұрын
amazing video thank you !!
@tapanachary2348
4 жыл бұрын
Wow , mind blowing explanation , thank you so much
@breakunknown
2 жыл бұрын
thanks a lot, simple and clear
@kartikxramesh
5 жыл бұрын
Great solution, I paused the video after seeing the question, and tried t solve it myself. Here how i was able to solve it using recursion. void printTree(Node* root){ static int flag = 1; //don't be confused about flag i'm only using it because otherwise every node except the if(!root) //original root node was printing twice return; if(flag){ cout
Пікірлер: 321