Thread: FunctionType visit and binary search trees

  1. #1
    Registered User
    Join Date
    May 2004
    Posts
    1

    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

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Binary trees search problem...
    By Umoniel in forum C Programming
    Replies: 2
    Last Post: 02-22-2004, 02:29 PM
  2. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM