I've read the topcoder tutorial about finding LCA using dp (this one) but I couldn't understand how the query function work. Any help would be appreciated.
I've read the topcoder tutorial about finding LCA using dp (this one) but I couldn't understand how the query function work. Any help would be appreciated.