I talk about performing ancestor checks with Euler Tours and querying for the lowest common ancestor of two nodes in O(log(N)). I don't explicitly explain tree flattening with Euler Tours (only ancestor checks) but what I explain is the main idea behind tree flattening as well.
I tried keeping this video short by only explaining things relevant to binary lifting and finding the lowest common ancestor of two nodes efficiently.
Here is my implementation:
https://pastebin.com/Xg6h4XJ9
Download
0 formats
No download links available.
Binary Lifting - Lowest Common Ancestor Queries | NatokHD