LCA with Sparse Table

Revision en1, by DiegoCosta, 2017-12-12 20:55:26

Hello Guys.

I'm novice at competitive programming. I'm trying to learn LCA. Firstly I learned LCA O(n) going up the nodes (u and v) linearly. After I learned LCA O(sqrt(n)) using sqrt-decomposition spliting the graph in buckets. Now I trying learning the LCA using Sparse Table, but I don't understand how this tecninque works. Someone can explain me, and shows the implementaion or pseude-code ?

P.S.: Sorry my english. LOL :)

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English DiegoCosta 2017-12-12 20:55:26 458 Initial revision (published)