Hi,
When I try use my insert function I get an unhandled exception error any reason why?
Thanks for your help,
Daniel
[tag]
[/tag]Code:void insertBST(node *&root, node *temp) { if(root == NULL) root = temp; else { while((temp->data <= root->data && root->left != NULL) || (temp->data >= root->data && root->right != NULL)) { if(temp->data < root->data) root = root->left; else root = root->right; } if(temp->data <= root->data) root->left=temp; else root->right = temp; } }