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?
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
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.
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.
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.
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.
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 UA-cam that is perfectly clear. Thank you my friend!
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
I can't explain how valuable this video is. Thank you so much. Best explanation in the YT so far.
This is the best explanation so far on Inorder Successor. You are a great teacher. Thanks a ton!! :)
sir explanation is really great
Best explanation ever.... All your videos are lucid and to the point. Keep it up... Thank you
Very nice explanation. you are one the few guys who try to explain how to think. Awesome.
Thank you, Vivekanand! We appreciate you!
My pleasure
This is the best explanation . Awesome!! I wish all teachers were this good India would have been going greats
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 great explanations sir
Best explanation on the web. Thanks!!
One of the best explanation
Thank you sir .Your explanations are best and i have learned a lot from you.Keep making videos like this.
easy and lucid way of teaching.......!thanks
Way better than my fucking CS class at a "top" American University. He is so composed, I love it and absorbing everything .
Can you please do a series of algorithm questions for interview prep in a week. Sort of like things you absolutely need to know
very nice explaining sir....You rocked
Very helpful, especially explanation with example
What an explanation!! This should how professors teach teach their students. Keep it up! Thanks for uploading this well explained and organized video.
u r amazing .. hope you land the best companies
This was a really good explanation. Thanks a lot
awesome sir
hi sir, can you please make more algorithms videos on trees, linked list, graphs, and some other important algorithms for interviews
what about the case where target is 105? how to check if that is the last node of the tree?
awesome Sirji!
BEST explanation I've ever seen
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
very good explanation
nice explanation. thank you.
awesome explaination
best video i ever seen.....
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 the best 🍁
Thank you, this was the best material on the topic
Hi Vivekanand, great explanation! I am really impressed. Can you please create a separate video on Big O and Time Complexity?
this video honestly deserves like
Excellent, thank you.
Thanks a lot for explaining so beautifully.
Thank you very much for the great explanation in all your videos..keep going
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.
Amazing explanation, That was a tough one :)
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.
Best explanation as always. Keep it up 👍
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
Excellent Explanation
Thank u sir
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.
Great Explanation. Respect!
Not a single dislike! Awesome!
Awesome explanation ! Thanks !
Sir, please use duster, rubbing the marker ink through your fingers may cause skin problems.
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
Vivekanand sir would you please explain the time complexity of the algorithm also?
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.
10:19
Great Explanation tho. (Y)
Thanks 🙏 😊
Thank u sir ♥️
sir what if the user given a node which is a leaf node what will be the algo for this condition??
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.
Like array tutorial do have any tutorial for Strings related question
Many Thanks
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.
HI Vivek,
Can you please post the code for deletion of a node from BST?
What if inorder succesor does not exist, suppose given node is root node and there is no right subtree for it.
Thanks sir
Thank you 😀😁
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..
you can ask me in comments, and I will never reply.. because he has not replied to any of the comment.
thanks
Gem.
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
Can you please show how to convert roman number to number was a interview question..
can I achieve this through recursion
16:30 also say that first untraversed parent
wuah😃
Sir is video ka code kha milegea
Muje code cahhiye sir pls
bhai ek request hai apse please hindi me bol liya kijiye..english teak se explain nai kr pa rhe ho ap
sir upload graph
Where is The Source Code
This Logic is Not Working in all Cases
are you single? ;)
very good explanation