Although I was in Vietnam, I do not know much about English, but you preach is easy to understand . Easier to understand than the Vietnamese . Fantastic !! Thank you very much.
@mycodeschool10 жыл бұрын
Dũng Nguyễn Hoàng Anh Love to Vietnam :)
@ntlzz939 жыл бұрын
Dũng Nguyễn Hoàng Anh me too.
@priyaravindran43374 жыл бұрын
SW Engineer for 7 years ...Computer Science graduate ...but understanding DSA concepts clearly now !! Thanks much !!
@sasaskvorc59410 жыл бұрын
Thank you very much for your efforts. If i get a programer job thanks to this videos i will make a donation as soon as i can. You are way better than my profesors. Keep up the good work.
@mycodeschool10 жыл бұрын
Saša Škvorc Thanks a lot and all the best to you :)
@aswin2pranav8 жыл бұрын
Doing the god's work really
@joycalcutta7 жыл бұрын
:D - really funny dude!
@FarhanAli-km5id4 жыл бұрын
I really really liked that video, because this tutorial provides"recursion method" as well as"Non recursion method" .. Thanks for that beautiful effort 💞.. from Pakistan...
@arunanshupadhi10 жыл бұрын
Great tutorials dude.. could you please upload a video on finding permutations of a string in c?
@vandananayak94262 жыл бұрын
I miss your videos sir. We all need a teacher like you. #respect
@newoap10 жыл бұрын
Superb tutorials. What about creating a video on deleting from a BST?
@mycodeschool10 жыл бұрын
Owen Parkinson Yeah, I will create one on deleting node from BST. :)
@Gameplay-pq6hk8 жыл бұрын
please make videos for AVL TREE , THREADED ,B-TREE .
@wangchi562 Жыл бұрын
Please come back sir, we need you
@prestoX6 жыл бұрын
Thanks a ton Sir Kindly upload some videos on Balancing trees and AVL trees.
@ridershubham10 жыл бұрын
the best tutorials!!! awsm work......plz prepare such a sereis for AVR Cprogramming...
@cdeba98674 жыл бұрын
I am devouring your course
@jonsnow92467 жыл бұрын
Superb video..I have a doubt In the recursive approach,what happens to the paused function,wont they give an error return statement missing? because for the paused functions there is nothing below return FindMin(root->left); .........and return type of the function is int!
@ktp69310 жыл бұрын
Very clean and easy to understand! Thanks!
@Gurl975-b9o11 ай бұрын
Can u pl tell its complexity?!
@mersenne2486 Жыл бұрын
we don't need to use return in the last line, we can directly call the function, is it that using return reduces stack frame from growing as the last function ends before calling the new function
@ኢትዬ5 жыл бұрын
You r a great teacher! Keep it up mate!
@Bhargava954 жыл бұрын
I have decided to give you a Nobel Prize!!
@jaekim94969 жыл бұрын
Beautifully explained. Thank you so much.
@ryklin18 жыл бұрын
The only thing I do not like about this implementation is that negative integers can be stored in this tree, so returning -1 when the root is NULL creates a conflict. Instead, I think it would be better to throw an exception when the root is null. Does anyone have a better suggestion?
@goodToBeLost7 жыл бұрын
That's right. But any suggestions on what we could do if we know that the B.S.T can have negative values? :)
@odotodate6 жыл бұрын
You could return the minimum value of the Integer class. How you get that value depends on your language (i.e. Java = Integer.MIN_VALUE)
@inception2523 жыл бұрын
@@goodToBeLost XDDDD
@5586manali10 жыл бұрын
when you say root can be used as a local variable, I tried the following code snippet. #include struct node { int data; struct node *next; }; void change_data(struct node *root) { root->data = 7; } int main() { struct node *root; root = (struct node*)malloc(sizeof *root); root->data = 5; change_data(root); printf(" root data:%d",root->data); } With your logic, changing root->data in change_data should not change the root in main function. however the output of this function is 7 not 5. Can you explain the same?
@vzfzabc9 жыл бұрын
Indeed, the answer you get is expected one. Because you are modifying the same chunk of the memory. You pass to the method change_data() an address(which is the reference to the malloced memory) that you keep at **root(pointer to pointer root), and this address is assigned as a value of the **root(pointer to pointer) that you have in change_data which is not equivalent to the **root in main. From the output of the following snippet, you will notice that **root in main() and change_data() is different, however the address they keep is the same. Hope, it helps. #include #include struct node { int data; struct node *next; }; void change_data(struct node *root) { printf("change: * %p ", root); printf("change: **%p ", &root); root->data = 7; } int main() { struct node *root; root = (struct node*)malloc(sizeof *root); root->data = 5; change_data(root); printf("main: * %p ", root); printf("main: **%p ", &root); printf(" root data:%d",root->data); }
@idamooooo9 жыл бұрын
+Manali Bhutiyani TL;DR answer: To get the result you are looking for, your function change_data(struct node *root) should return type struct node*. Then in your main, change to: root = root->data=5 That way, your main function is assigned to the address of the newly changed node.
@mohammedamaan73514 жыл бұрын
int FindMin(BstNode* root) { if (root == NULL) return -1; if (root->left) return FindMin(root->left); else return root->data; }
@akshay86754 жыл бұрын
To find the maximum or minimum element we have to provide the pointer to the root node no? how is it done?
@chintandesai14369 жыл бұрын
How do we make sure that current -> left will actually traverse left and not right side ?
@akshay86754 жыл бұрын
To find the maximum or minimum element we have to provide the pointer to the root node no? how is it done?
@tareqdevdiary4 жыл бұрын
How to call FindMin() function from main function? Which argument should I pass in FindMin() function?
@danielcarrera68134 жыл бұрын
pass the address of the root node
@MyStar9707 ай бұрын
Very well explained
@ujjwal94roy5 жыл бұрын
Very nice explanation
@maroben2259 жыл бұрын
im confused ...if root->left ==NULL ..why wouldnt it go to the first if ( root ==null) ..instead of going to else if (root-left ==null) how will he reconize it ..isnt it a local variable !
@harmanpreetkaur591010 жыл бұрын
seriously awesome videos ..could u plz upload a video on graphs..
@mycodeschool10 жыл бұрын
Harmanpreet Kaur Yeah, I am a bit slow.. I am not getting the time. But Graph is next on my list. Expect some videos on Graph in August.
@srividhyaparthasarathy54014 жыл бұрын
Why isn't the condition for while loop is not current!=null and y is it current->next!= Null?
@usama579266 жыл бұрын
bro u return -1 if the tree is empty but think if the tree is not empty and the minimum value in tree is also -1 then it will return -1 so how can u manage this condition in main function.
@singhsarbjit5 жыл бұрын
There is an assumption in this example that he described - "Tree is storing only positive numbers"
@ivannav6 жыл бұрын
Thanks, great vid!
@Surbhi18115 жыл бұрын
I am in love with your videos...awesome
@SumitKumar-fn3gj5 жыл бұрын
And I am in love with you
@usama579266 жыл бұрын
amazing explanation
@tonyy086 жыл бұрын
So the minimum for this problem will be 2?
@dattabezawada9734 жыл бұрын
Can I get a complete C# code for this
@suneelabbigari4 жыл бұрын
Can someone provide all the possible operations (insert, delete, search, height, print infix , prefix and post fix order) with recursion in single program. Please use "root" as global variable...don't want to return pointer every time. struct node * root = NULL in global scope is must.
@victorstan48136 жыл бұрын
thank you very much, it helps me a lot!!
@erehuchiha3034 жыл бұрын
Will it work for a right screwd tree where min element is root itself?
@akhilgupta36644 жыл бұрын
Yes it will definitely worked for all type of binary tree. As Left and Right skewed tree are also Binary tree as they have atmost 2 child actually one child except the leaf node which do not have a child node . So in case of skewed tree to find min in right skewed the first condition will itself true so we return root data as it is. Same in case of finding max in left skewed tree . Hope it helps !!
@malathalaqrabawi78398 жыл бұрын
how to find the next min???
@khaledsaleh42386 жыл бұрын
I'd think to add another pointer ( let's call it Prev ) and go recursively through the whole left subtree till you find the leaf as he did in this video and just return Prev -> data instead; Hope this helps!
@aliiqbal3809 жыл бұрын
great work sir. :-)
@ShivamKendre-fc3su3 жыл бұрын
Great video
@jatinverma47886 жыл бұрын
why the root in main doesn't change when we are passing the address of root in Findmin()???
@jayantprakash64256 жыл бұрын
bcz we are passing root pointer by reference so function will have its own copy of root pointer, not affecting the original
@rahul27493 жыл бұрын
3:14,4:11,5:34
@kamlendratripathi89633 жыл бұрын
what is the time complexity of iterative and recursion approach
@SHIVANSHTHAKUR-cd6lv3 жыл бұрын
i think O(log(n)) for iterative, because we are dividing are problem by half at each step and may be same in recursion. Instead of big-O we can use theta as well because we are sure that it is the left most/right most element for min/max elements.