awesome explaination.. i thought this topic was my full stop for the DSA course which i'm studying online until i came across ur video.. thank you so much.. i am ready to continue :) you got a new subscriber here #respect
Amazing explanation! Just a quick question: The time complexity of the solution shall be O(height) but should the space complexity be also O(height) => Recursive calls to search for the target node for BST?
Thanks from your explanation, which is easy to understand, a confusion is here how to find the in order successor for 36 in the above example? please help me it is much urgent for me.
from case 2, i do from bottom, so i start looking its successor from the key (37) than i compare it with parent and another node, final result is same 40
You are given a list of projects and a list of dependencies ( which is a list of pairs of projects, where the second project is dependent on the first project). All of a project's dependencies must be built before the project is. Find a build order that will allow the projects to be built. if there is no valid build order, return an error. Input: projects: a, b, c, d, e, f dependencies: (a,d), (f,b), (b,d), (f,a), (d,c) Output: f, e, a, b, d, c
Hi vevekanand, thanks for such a wonderful explanation. You mentioned that tree cannot be reversely traversed, means backtracking. But we can achieve the same using recursion. Please let me know your thoughts on that.
Sir what will be the output for the value 105? Here I was getting garbage value but tried to solve by means of some logic but problem is not fixed. Will you please discuss that? Thanks again.
sir upload an video on dynamic problem;- Given arrival and departure times of all trains that reach a railway station, find the minimum number of platforms required for the railway station so that no train waits.
If we have to find the inorder successor of last node i.e. 105, then can we assume that if there is no left turn happened during the search path of node 105 then there is no successor. Kindly suggest.
Yeah I was thinking the same thing. If we had a pointer where if (currentNode TAG == 0) then just return that Link which would be the Successor, i.e. the Parent
The way you just explain everything 20 times over again is amazing. It really engraves the content into my mind. Great video!
I didn't understand this until i watched the video. so true! lol
Probably the only explanation on RUclips that is perfectly clear. Thank you my friend!
I can't explain how valuable this video is. Thank you so much. Best explanation in the YT so far.
only explanation in youtube covering all the cases👍
awesome explaination.. i thought this topic was my full stop for the DSA course which i'm studying online until i came across ur video.. thank you so much.. i am ready to continue :) you got a new subscriber here #respect
This is the best explanation so far on Inorder Successor. You are a great teacher. Thanks a ton!! :)
Best explanation ever.... All your videos are lucid and to the point. Keep it up... Thank you
This is the best explanation . Awesome!! I wish all teachers were this good India would have been going greats
Thank you sir .Your explanations are best and i have learned a lot from you.Keep making videos like this.
Explanation work is done well but the boundary case if we have to find successor of maximum node in tree will not be handled by this algo
Amazing explanation!
Just a quick question:
The time complexity of the solution shall be O(height) but should the space complexity be also O(height) => Recursive calls to search for the target node for BST?
Very nice explanation. you are one the few guys who try to explain how to think. Awesome.
Best explanation on the web. Thanks!!
What an explanation!! This should how professors teach teach their students. Keep it up! Thanks for uploading this well explained and organized video.
Thanks from your explanation, which is easy to understand, a confusion is here how to find the in order successor for 36 in the above example? please help me it is much urgent for me.
sir explanation is really great
Thank you, Vivekanand! We appreciate you!
My pleasure
This was a really good explanation. Thanks a lot
Way better than my fucking CS class at a "top" American University. He is so composed, I love it and absorbing everything .
from case 2, i do from bottom, so i start looking its successor from the key (37) than i compare it with parent and another node, final result is same 40
Can you please do a series of algorithm questions for interview prep in a week. Sort of like things you absolutely need to know
what about the case where target is 105? how to check if that is the last node of the tree?
One of the best explanation
You are given a list of projects and a list of dependencies ( which is a list of pairs of projects, where the second project is dependent on the first project). All of a project's dependencies must be built before the project is. Find a build order that will allow the projects to be built. if there is no valid build order, return an error.
Input:
projects: a, b, c, d, e, f
dependencies: (a,d), (f,b), (b,d), (f,a), (d,c)
Output: f, e, a, b, d, c
Read about Topological Sorting using Stack, that would help you.
u r amazing .. hope you land the best companies
very nice explaining sir....You rocked
very great explanations sir
Very helpful, especially explanation with example
hi sir, can you please make more algorithms videos on trees, linked list, graphs, and some other important algorithms for interviews
easy and lucid way of teaching.......!thanks
Hi vevekanand, thanks for such a wonderful explanation. You mentioned that tree cannot be reversely traversed, means backtracking. But we can achieve the same using recursion. Please let me know your thoughts on that.
dhawal patel lol they r same
Thanks a lot for explaining so beautifully.
Sir, please use duster, rubbing the marker ink through your fingers may cause skin problems.
BEST explanation I've ever seen
awesome Sirji!
Vivekanand sir would you please explain the time complexity of the algorithm also?
Thank you very much for the great explanation in all your videos..keep going
nice explanation. thank you.
Thank you, this was the best material on the topic
awesome explaination
Sir what will be the output for the value 105? Here I was getting garbage value but tried to solve by means of some logic but problem is not fixed. Will you please discuss that? Thanks again.
It should be null. Perhaps if the node is the maximum node in a bst then its successor will always be a null.
Excellent, thank you.
awesome sir
sir upload an video on dynamic problem;- Given arrival and departure times of all trains that reach a railway station, find the minimum number of platforms required for the railway station so that no train waits.
HI Vivek,
Can you please post the code for deletion of a node from BST?
sir what if the user given a node which is a leaf node what will be the algo for this condition??
this video honestly deserves like
Excellent Explanation
Best explanation as always. Keep it up 👍
best video i ever seen.....
You are the best 🍁
Nice explanation!!
What will be the inorder successor for 105 in this example?
Successor means the next higher value right? so for 105 there is no successor as this is the max value of that tree.
if store pointer is null that means there was no left turns made, thus no inorder successor.
If we have to find the inorder successor of last node i.e. 105, then can we assume that if there is no left turn happened during the search path of node 105 then there is no successor. Kindly suggest.
Yes there is no successor for 105
Amazing explanation, That was a tough one :)
Great Explanation. Respect!
Like array tutorial do have any tutorial for Strings related question
very good explanation
What if inorder succesor does not exist, suppose given node is root node and there is no right subtree for it.
Thank u sir
please make video on red-black tree.
Hi Vivekananda,
Can you please upload the video for finding all nodes at a distance k from a target node
Run BFS it gives you the shortest natural distance from starting node, keep track of the distance, you can use DFS too but BFS will be easier
HIMANSHU CHHABRA thanks . I will try it out.
If we had a parent pointer could we just do if(current node == left child of parent) then return that for case 2?
Yeah I was thinking the same thing. If we had a pointer where if (currentNode TAG == 0) then just return that Link which would be the Successor, i.e. the Parent
May be.
Awesome explanation ! Thanks !
Not a single dislike! Awesome!
nice explanation
can we also use stack ?
yeah sure...but without using stack u r able to solve this....then why do u want to use stack..
Many Thanks
Thanks 🙏 😊
Thank u sir ♥️
can I achieve this through recursion
Can you please show how to convert roman number to number was a interview question..
I would appreciate if you can show your code for case 2. Thank you.
yes sure...i have written the code on board ...but did not explain...will make a video on code explanation
can you do video on
splay trees
what about if it is an alphabets
Thanks sir
10:19
Great Explanation tho. (Y)
Thank you 😀😁
Sir is video ka code kha milegea
Muje code cahhiye sir pls
thanks
you can ask me in comments, and I will never reply.. because he has not replied to any of the comment.
bhai ek request hai apse please hindi me bol liya kijiye..english teak se explain nai kr pa rhe ho ap
Where is The Source Code
Gem.
16:30 also say that first untraversed parent
sir upload graph
This Logic is Not Working in all Cases
wuah😃
are you single? ;)
very good explanation