(a) (15 points) Implement a pointer-based Binary Search Tree whose keys are strings. Implement methods for insertion, deletion, and inorder traversal. The traversal method must return an ordered vector of keys. Put your code into the BSTNode.h, BSTNode.cpp, BST.h, BST.cpp files. Prototypes of the methods must be the following:
\begin{itemize}
\item void BST::searchTreeInsert(string key); \// 5 points
\item void BST::searchTreeDelete(string key); \// 5 points
\item vector<string> BST::inorderTraversal(BSTNode* root); \// 5 points
\end{itemize}
(b) (30 points) You are to write a C++ program to count the frequency (number of occurrences) of k-mers in a text file. A k-mer is defined as k consecutive non-overlapping characters in a given text. Assume that the input text contains only English letters 'a'...'z', 'A'...'Z' and has no blank space. All k-mers should be stored as lower-case letters only. For example, consider the following text:
\texttt{"ComputerScienceisFun"}
All of the 3-mers generated from this text should be as follows:
\texttt{"com", "put", "ers", "cie", "nce", "isf"}
Note that capital letters are converted to lowercase when k-mers are generated.
Your program should take the value of k as a parameter and construct the corresponding binary search tree (BST) according to the lexicographical order. You should use a pointer-based implementation of a BST to store the k-mers and their frequencies. (You can use the source codes available in the course book, or you can implement a BST yourself.) Each node object should maintain the associated k-mer as a string of size k, its current count as an integer, and left and right child pointers. On top of the regular operations that a BST has, you should implement the following functions:
\begin{itemize}
\item (5 points) addKmer(string kmer): adds the specified k-mer in the BST if not already there; otherwise, it simply increments its count.
\item (5 points) generateTree(string fileName, int k): reads the input text from a file and generates a BST of k-mers. In this function, you should detect all the k-mers in the input text and add them to the tree using the add-kmer function. This function also requires the parameter k.
\item (5 points) getUniqueKmerCount(): recursively computes and returns the total number of unique k-mers currently stored in the tree.
\item (5 points) getNumberOfKmerThatStartWith(char ch): recursively computes and returns the number of distinct k-mers that start with the given character. This function requires the input parameter for the first character.
\item (5 points) printAll(): recursively prints each k-mer in the tree in alphabetical order along with their frequencies.
\item (5 points) getHeight(): recursively computes and returns the height of the current tree.
\end{itemize}
For all these operations, your implementation should be efficient and should work on the BST directly. For example, you \texttt{cannot} copy all entries to a linear array, sort them, and return the results.