#include
using namespace std;
class node{
public:
int data;
node* left;
node* right;
node(int d){
data=d;
left=NULL;
right=NULL;
}
};
node* buildtree(){
int d;
cin>>d;
if(d==-1){
return NULL;
}
node* root=new node(d);
root->left=buildtree();
root->right=buildtree();
return root;
}
void printpre(node* root){
if(root==NULL){
return;
}
cout<data<<" ";
printpre(root->left);
printpre(root->right);
}
void printin(node* root)
{
if(root==NULL){
return;
}
printpre(root->left);
cout<data<<" ";
printpre(root->right);
}
int main()
{
node* root=bulidtree();//here is the error
printpre(root);
}
//error-51 23 C:\Users\91988\Desktop\c++\binarytree\binarytree2.cpp [Error] ‘bulidtree’ was not declared in this scope