prog.cpp: In function 'int KthNode(int, int, int)':
prog.cpp:3:22: error: 'LCA' was not declared in this scope
int lca = LCA(u,v) ; // O(logN) method to find LCA
^
prog.cpp:6:17: error: 'depth' was not declared in this scope
int d = depth[v] - depth[u] + 1 ;
^
prog.cpp:7:17: error: 'swap' was not declared in this scope
swap(u,v);
^
prog.cpp:12:16: error: 'depth' was not declared in this scope
if(k > depth[u]-depth[lca]+1) {
^
prog.cpp:13:13: error: 'd' was not declared in this scope
d = depth[u] + depth[v] -2*depth[lca] + 1;
^
prog.cpp:15:21: error: 'swap' was not declared in this scope
swap(u,v);
^
prog.cpp:18:15: error: 'LG' was not declared in this scope
for(int i=LG;i>=0;--i) {
^
prog.cpp:20:17: error: 'parent' was not declared in this scope
u = parent[i][u] ; // parent matrix precomputed for finding LCA
^