#include<stdio.h>
#include<stdlib.h>
int max;
typedef struct biTree{
int data;
struct biTree *left;
struct biTree *right;
}bt;
bt *createTree()
{
int data;
scanf("%d",&data);
bt *root;
if(data==-1)
return NULL;
else
{
root=(bt *)malloc(sizeof(bt));
root->data=data;
root->left=createTree();
root->right=createTree();
return root;
}
}
bt* maxnode(bt *root)
{
if(root)
{
if(root->data>max)
max=root->data;
bt *temp=maxnode(root->left);
bt *temp_1=maxnode(root->right);
}
}
int main()
{
bt *root=createTree();
max=root->data;
bt *maxNode=maxnode(root);
printf("maxnode = %d\n",max);
return 0;
}