TopCoder Forums RSS Feed
http://apps.topcoder.com/forums/
Most recent forum messagesenTue, 20 Mar 2018 11:28:17 -0400Error in LCA <O(N log N), O(log N)> solution?
http://apps.topcoder.com/forums/?module=Message&messageID=2028452
When j = 0, then: P[i] [j] = T[i]; When j > 0, then: P[i] [j] = P[ P[i] [j-1] ] [j-1]

Since P[i] [j] is the (2^j)-th ancestor of i, when j > 0, I think P[i][j] should be:

P[i] [j] = P[ P[i] [j-1] ] [1]

Please correct me if I am wrong. Thank you.</o>

Updated on 10/06/2015: Never mind, the original version is correct.]]>jxiang.sdTue, 23 Jun 2015 10:27:31 -0400Tue, 23 Jun 2015 10:27:31 -0400Tue, 06 Oct 2015 09:03:00 -0400jxiang.sd0