C++ The goal of this assignment is to implement a new search function that retur
ID: 3820645 • Letter: C
Question
C++
The goal of this assignment is to implement a new search function that returns a pointer to the correct node if the search term matches the data in the node, otherwise returns NULL. Also implement a print function that will go through the nodes of the tree and print them out in ascending order. You can use either a Recursive approach or a non-recursive approach. Test your code, with the following actions as inputs (program these in main) 1. create new binary tree 2. insert "John" 3. insert "Mary" 4. insert "Tim" 5. insert "Jose" 6. insert "Alice" 7. print out all items in the tree 8. use your new search function to search for "Jose", if returned node is not NULL print out "Found".Explanation / Answer
#include<iostream>
#include<string.h>
struct node
{
int key_value;
node *left;
node *right;
};
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.