मैं इस कार्यक्रम में विभाजन गलती का सामना करना पड़ रहा है। प्रवाह के रूप में मैं पता लगा इसे होने की सही हो रहा है। कृपया, मेरी मदद को इस कार्यक्रम में त्रुटि पता लगाने के।
#include<iostream>
#include<cstdlib>
using namespace std;
struct node
{
int data;
struct node* left;
struct node* right;
};
typedef struct node* Node;
void insert(Node,int);
Node root = NULL;
int main()
{
insert(root,2);
insert(root,1);
insert(root,3);
cout<<root->data<< <<root->left->data<< <<root->right->data<<endl;
return 0;
}
void insert(Node nod,int val)
{
if(nod == NULL)
{
Node newnode = new(struct node);
newnode->data = val;
newnode->left = NULL;
newnode->right = NULL;
nod = newnode;
if(root == NULL)
{
root = newnode;
}
}
else if(nod->data > val)
{
insert(node->left,val);
}
else if(nod->data < val)
{
insert(nod->right,val);
}
}













