please have a look at my code and tell me why am I not able to get any output ?
#include<bits/stdc++.h>
using namespace std;
class Node{
public:
int data;
Node *left;
Node *right;
Node(int d){
data=d;
left=NULL;
right=NULL;
}
};
Node *root=NULL;
Node *insertBST(Node *root,int d){
cout<<“d is”<<d<<endl;
if(root==NULL){
root= new Node(d);
return root;
}
cout<<“yo yo”;
if(d<=root->data)
root->left=insertBST(root->left,d);
else
root->right=insertBST(root->right,d);
return root;
}
node *pre(Node *root){
if(root==NULL){
return root;
}
cout<data<<" ";
pre(root->left);
pre(root->right);
}
int main() {
int t;
cin>>t;
while(t–){
int n;
int d;
cin>>n;
for(int i=0;i<n;i++){
cin>>d;
insertBST(root,d);
}
pre(root);
}
return 0;
}