Help me out in this



wrong answer is coming

Hey @shivammishra20121999

        if(root->right!=NULL)
        {
            mxpath(root->right,dis+1);//root->right here
        }

@Kartikkhariwal1 thks kartik can you tell me some technique you follow in recursion algorithm?

Recursion is PMI
write base case
assume true for n-1th thing so simply collect it as ans
and work on nth thing assuming n-1th is true.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.