CS计算机代考程序代写 // Binary Search Tree class

// Binary Search Tree class
//Doxygen comments needed in the declaration

// Make sure Bst is minimal and complete.
// Code from Lab 9 can come here too.

template
struct nodeType // answer why struct encapsulation is used – rationale
{
// your write the code
};

typedef void (*f1Typ)(T &); // you are not restricted to a single parameter. You
// decide on how many parameters and provide rationale

template
class Bst // answer why class encapsulation is used – rationale
{

public:

// you write whatever else is needed. You already have some from Lab 9.
// insert is needed.

void inOrderTraversal(f1Typ f1 ) const;

void preOrderTraversal() const; // parameter f1 in here too. left as an exercise
void postOrderTraversal() const; // parameter f1 in here too. left as an exercise

private:

nodeType *root;

// you write the rest

void inOrder(f1Typ f1, nodeType *p) const;
// you write whatever else is needed.

};

// you write the rest. You already have some from Lab 9.