Regarding implementation of tree

Here, u and v denote that an edge exists between u and v (if you’re talking about SJ1, SUBREM, MINXOR) … you have to do something like this
adjList[u-1].pb(v-1);
adjList[v-1].pb(u-1);
(u-1 and v-1 because it’s 1 indexed)
(Heat pb means push_back)
You then run a function using stack to get the parent child relation for every node …