Largest bst in a bt


why giving run time error?could you nodify the code and highlight the mistake

Hello @Vibhuti0206

Your code to build the tree using the preorder traversal and inorder traversal is incorrect.
At line 62 and 65, it should be ā€œiā€ and NOT ā€œnā€ in your code
Inside isValidbst function include this code
if(root == NULL) {
return 0;
}

Here is the Modified code:- https://ide.codingblocks.com/s/158739