Question: This is the code that I currently have. Need help with creating the rest. #include avl_tree.h //#include avl_tree_modified.h //#include sequence_map.h // You will have to
This is the code that I currently have. Need help with creating the rest.
#include "avl_tree.h" //#include "avl_tree_modified.h" //#include "sequence_map.h" // You will have to add #include "sequence_map.h"
#include
namespace {
// @db_filename: an input database filename. // @seq_filename: an input sequences filename. // @a_tree: an input tree of the type TreeType. It is assumed to be // empty. template
} // namespace
int main(int argc, char **argv) { if (argc != 3) { cout
return 0; }

Next, create a test routine named test_tree that does the following in the sequence described below: a. 6.9 a. 1. Parses the database and construct a search tree (this is the same as in Part2(a)). 2. Prints the number of nodes in your tree n. 3. Computes the average depth of your search tree, i.e. the internal path length divided by n. Prints the average depth. b. Prints the ratio of the average depth to log2 n. E.g., if average depth is 6.9 and log2 n = 5.0, then you should print = 1.38. 5.0 4. Searches (find()) the tree for each string in the sequences.txt file and counts the total number of recursive calls for all executions of find(). Prints the total number of successful queries (number of strings found). b. Prints the average number of recursion calls, i.e. #total number of recursion calls / number of queries. 5. Removes every other sequence in sequences.txt from the tree and counts the total number of recursion calls for all executions of remove(). Prints the total number successful removes. b. Prints the average number of recursion calls, i.e. #total number of recursion calls / number of remove calls. 6. Redo steps 2 and 3: Prints number of nodes in your tree. b. Prints the average depth. c. Prints the ratio of the average depth to log2 n. a. a. Next, create a test routine named test_tree that does the following in the sequence described below: a. 6.9 a. 1. Parses the database and construct a search tree (this is the same as in Part2(a)). 2. Prints the number of nodes in your tree n. 3. Computes the average depth of your search tree, i.e. the internal path length divided by n. Prints the average depth. b. Prints the ratio of the average depth to log2 n. E.g., if average depth is 6.9 and log2 n = 5.0, then you should print = 1.38. 5.0 4. Searches (find()) the tree for each string in the sequences.txt file and counts the total number of recursive calls for all executions of find(). Prints the total number of successful queries (number of strings found). b. Prints the average number of recursion calls, i.e. #total number of recursion calls / number of queries. 5. Removes every other sequence in sequences.txt from the tree and counts the total number of recursion calls for all executions of remove(). Prints the total number successful removes. b. Prints the average number of recursion calls, i.e. #total number of recursion calls / number of remove calls. 6. Redo steps 2 and 3: Prints number of nodes in your tree. b. Prints the average depth. c. Prints the ratio of the average depth to log2 n. a. a
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
