Largest BST in binary tree

showing segmentation fault. Help. Also check if right approach @O17LPOLC0033 @vishal
https://ide.codingblocks.com/#/s/17217

It’s run time error.
you should make a constructor for NodeAttri class and thats it
But still this just removes the run error, when you are going up in recursive call you should maintain minimum value in right tree and maximum value in left tree so that you can check whether the present tree is a BST or not ( you are just comparing the values tree ->data,tree->lchild->data,tree->rchild->data which will give you wrong answer )