क्या एक के निम्नलिखित कार्यान्वयन के साथ गलत क्या है द्विआधारी खोज वृक्ष (बीएसटी) ? मुझे बताया गया है कि यह करने के लिए एक सूचक सूचक का उपयोग करने के लिए बेहतर है structडालने समारोह में एक तर्क के रूप नोड।
struct node
{
int key_value;
struct node* left;
struct node* right;
};
insert(int key, struct node *leaf)
{
if( leaf == 0 )
{
leaf = (struct node*) malloc( sizeof( struct node ) );
leaf->key_value = key;
/* initialize the children to null */
leaf->left = 0;
leaf->right = 0;
}
else if(key < leaf->key_value)
{
insert( key, leaf->left );
}
else if(key > leaf->key_value)
{
insert( key, leaf->right );
}
}













