//UMBC - CSEE - CMSC 341 - Fall 2025 - Proj2 #include "booktree.h" BookTree::BookTree(){} BookTree::~BookTree(){} void BookTree::loadData(Book data[], int arrayLength){ } bool BookTree::insert(string title, string author, string text){ } int BookTree::findFrequency(string title, string word){ } int BookTree::searchCount(string title, string word){ } int BookTree::getTextTreeHeight(string title){ } string BookTree::getRootKey(){ // implementation is provided // do not modify this function return m_root->m_title; } bool BookTree::removeWord(string title, string word){ } void BookTree::dump(bool verbose) const{ //cout << "m_root is " << m_root->m_title << endl; dumpHelper(m_root, verbose); cout << endl; } void BookTree::dumpHelper(BNode* root, bool verbose) const{ if (root != nullptr){ if (verbose){ cout << "("; dumpHelper( root->m_left, verbose ); cout << root->m_title << ":" << root->m_author; root->m_tree.dump(); dumpHelper( root->m_right, verbose ); cout << ")"; } else{ cout << "("; dumpHelper( root->m_left, verbose ); cout << root->m_title; dumpHelper( root->m_right, verbose ); cout << ")"; } } } /////////////////////////////////////////////////////////////////// WordTree::~WordTree(){ } Node* WordTree::find(const string& word){ } bool WordTree::remove(const string& word){ } void WordTree::insert(const string& word){ } int WordTree::searchCount(string word){ } int WordTree::getTreeHeight(){ // implementation is provided // do not modify this function return m_root->m_height; } void WordTree::dump(std::ostream& ostr){ dump(m_root, ostr); } void WordTree::dump(Node* aNode, std::ostream& ostr){ if (aNode != nullptr){ ostr << "["; dump(aNode->m_left, ostr);//first visit the left child ostr << aNode->m_word << ":" << aNode->m_count << ":" << aNode->m_height;//second visit the node itself dump(aNode->m_right, ostr);//third visit the right child ostr << "]"; } } //////////////////////////////////////////////////////////// BNode::BNode(){} BNode::BNode(string title, string author, string text){} BNode::~BNode(){} int BNode::findFrequency(string word){ } int BNode::searchCount(string word){ } int BNode::getTextTreeHeight(){ }