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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!