About binary tree

#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

hi @gauravbeniwal98 send the code on any onilne ide

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.