my idea is simply have a function that checks the id of a node by taking it's pointer => nodeID
Then I traverse the tree until it found nodeID(tree pointer) == id. Then I calculate the depth by using ldepth and rdepth.
Initially i intend to do it in 1 function using recursion, but failed to do so.
So i used 2 functions,1 doing the recursion and another just takes the result and process.
However, it never really worked
int nodeDepth(CPPtr tree, int id)
//Define nodeDepth_Helper to do the actual recursion to find lDepth and rDepth
void nodeDepth_Helper(CPPtr tree, int id, int& lDepth,int& rDepth)
if (tree != NULL)