FunctionType visit and binary search trees
In my textbook dealing with binary search trees, in the BST.h header file, they include a function thing as follows:
typedef void (*FunctionType)(TreeItemType& anItem);
They really don't give much of an explination as to what this does and I don't understand how you can write this syntactically or why it works. Also, each of the traverse functions such as
inorderTraverse(TreeNode *treePtr, FunctionType visit)
They use FunctionType visit as a paramater.
Also, there is another function that can be defined in the driver:
void display(TreeItemType& anItem); which is also used in some functions as a parameter of type FunctionType.
Can someone explain to me what is going on here because I just don't understand it. Thanks