//************** // concordance BST // // inherits from spefic type of BST // namely BST that contains concordance // data (CData) class // // overrides Insert // now updates count within CData if already in the tree // adds public PrintNodes // takes an occurrence frequency and prints only those // node with count >= frequency. If frequency = 0, // prints entire tree in-order by using BST Print_Tree method // else uses its own private PrintSomeNodes // // DL Frey 10/21/98 //************************* #ifndef __CTREE_H_ #define __CTREE_H_ #include "bst.h" #include "cdata.h" class CTree : public Binary_Search_Tree { private: // prints all nodes with count >= f // if f = 0, prints entire tree void PrintSomeNodes (Tree_Node *T, int f) const; // this insert increments the count if // the word is already in the tree void Insert (const CData& word, Tree_Node * &T); public: // overriding BST's insert virtual void Insert (const CData& word) { Insert (word, Root); } // print all nodes with count >= freq void PrintNodes (int freq = 0) const; // prints one node after find void PrintANode (const CData& word) const; }; #endif