int diameter(node* root)
{
if(root=NULL)
{
return 0;
}
int h1=height(root->left);
int h2=height(root->right);
int d1=h1+h2;
int d2=diameter(root->left);
int d3=diameter(root->right);
return max(d1,max(d2,d3));
}
int main()
{
node* root=buildTree();
/printPreOrder(root);
cout<<"\n";
printInOrder(root);
cout<<"\n";
printPostOrder(root);
cout<<"\n";/
// cout<<height(root)<<"\n";
// printingAllLevel(root);
// cout<<"\n";
//bfs(root);
//cout<<count(root)<<"\n";
//cout<<sum(root)<<"\n";
cout<<diameter(root)<<"\n";
return 0;
}