Creating Traversals for Binary Search Tree with Recursion.
void inOrder(void (*inOrderPtr)(T&))
{
if(this->left != NULL)
inOrder((*inOrderPtr)(this->left));
inOrderPtr(this->data);
if(this->right != NULL)
inOrder((*inOrderPtr)(this->right));
}
Here is the function. Now this is obviously wrong. This function is called like this:
first.inOrder(print_vals);
first is the object, and print vals is simply a function that prints what is the data in the object. There are three values for each object, data, left, and right. How do I actually access those items with the function?