this program finds how many levels the tree has at right and left side and finaly returns the maximum level of the two variablesCode:int Depth(NODE *base) { if (base==NULL) { return(0); } else { int ltree = Depth(base->left); int rtree= Depth(base->right); if (ltree > rtree) return(ltree+1); else return(rtree+1); } }
my question is after it reach the NULL both int variables will have the 0 value so only the else of the if statement will be TRUE so only the rtree will be increased
can you please explain me how this code really works