This method is useful if we need to compare LCA of two nodes again and again because preprocessing takes O(n logn) and then finding LCA will take O(logn) time. But if we need to find it once we will use other approaches that will take O(n) time. Binary lifting is better compared to that O(n*n) solution. Am I right?? Correct me if wrong.
Nice Video !!! One question just do we need to break in for loop once we got the first mismtach when dp[u][i] != dp[v][i] so that at last we can use return dp[u][0]
The explanation is crystal clear!
this is the best explanation I have ever seen
The name of your channel is totally apt. Thanks a lot 😌☺️
Your explanations were crystal clear my friend thanks a lot for the video .
Awesome explanation
The explanation is crystal clear !
btw thanx a lot.
I like it... explanation it also very good.... also upload more algorithmic videos.
Yeah Bro! Vaidik you should start making such videos too!
Thanks for the explanation. It was super easy to understand.
just wow !!
Thanks for the tutorial 😀
Your welcome!
we can also find lca by eular tour + seg tree in logn then what is advantage of binary lifting over seg tree
Binary lifting is a lot simpler than using euler tree + seg tree.
@@fluentalgorithms4847 thank you
wow!!
nice,
thanks for the explanation
Amazing explanation!
YOU ARE VERY HEAVY TEACHER, THANKS A LOT
Really nice explanation
This method is useful if we need to compare LCA of two nodes again and again because preprocessing takes O(n logn) and then finding LCA will take O(logn) time. But if we need to find it once we will use other approaches that will take O(n) time. Binary lifting is better compared to that O(n*n) solution. Am I right?? Correct me if wrong.
You are right. For calculating lca only once, you can still use binary lifting if that extra logn doesn't bother much.
@@fluentalgorithms4847 Thank you
Please make a video on Heavy Light Decomposition.
Will consider!
Very good!!
Great explanation bro..
Whats the value of logN here ?
Beautiful. Keep up the good work.
how to get the path from u to v from this?
You can get the distance between 2 nodes by finding their lca. distance = (dist of u from root) + (dist of v from root) - 2* (dist of lca from root)
AMAZING!
Nice Video !!! One question just do we need to break in for loop once we got the first mismtach when dp[u][i] != dp[v][i] so that at last we can use return dp[u][0]
I didn't understand your question. Can you elaborate?
No you have to complete the loop
Very helpful. Thanks.
Thanks :)
if possible than give link of your code.
I have added the link in the description.
Good vdo, I should appreciate;)
excellent
fajny jetes
Not good at all . Especially in second part of finding LCA , You couldn't make a good explanation .
And you exist, but why?