Question: I need help inserting new nodes in the BST, the code is not complete for personal reasons. Any implementation on how to add new nodes
I need help inserting new nodes in the BST, the code is not complete for personal reasons. Any implementation on how to add new nodes would be appreciated.
int main() { { printf("After searching, 5 was found "); if (root, 5); else
printf("5 was not found in tree ");
if (root, 7)
printf("After searching, 7 was found ");
else
printf("7 was not found in tree ");
if (root, 16)
printf("After searching, 16 was found ");
else
printf("16 was not found in tree ");
if (root, 15) printf("After searching, 15 was found ");
else printf("15 was not found in tree ");
cout << " The Inorder traversal of the BST is "; printInorder(root);
} return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
