please find attached specification of assignment
Binary Search Tree Overview Your task is to implement a BST class, where every vertex is denoted by a string, and every vertex has a weight. The class should allow the weight to be any numeric data type, such as int, float, or double. The vertices are sorted by their weights. For example, the following BST has 8 vertices: "C", "A", "H", "D", "G", "F", "B", "E" (we list the vertices in breath-first traversal order). These vertices have weights of 5, 1, 10, 3, 20, 15, 30, 17. The class should offer a reasonably effective suite of operations, including but not limited to: · Adding and removing nodes (and relevant edge adding and removal). · Depth-first and breadth-first traversals (Preorder, Inorder, Postorder, BFS). · Finding paths that meet certain conditions. The Code You are provided with two files: · tree.hpp: this includes most of the basic definitions you will need. You should define data structures to represent a Binary Search Tree and implement the functions so that they can work correctly. You may add new includes, classes, functions, and/or variables to the class per your need, as long as they do not interfere with the existing definitions. You must NOT change the class name, template, parameters, or return types of functions. · main.cpp: this includes a main function. You may write some code to test your data structures and function implementations for the class. This file will not be marked so you can do anything you like with it -- just ensure it does not cause any error. When the "run" button is pressed, it will compile and run main.cpp. The code has been commented on to explain the purpose of each function. Remember to read over all the code before starting. MAIN.CPP #include "tree.hpp" int main(){ BST
t; t.add_vertex("A", 1); t.add_vertex("B", 3); t.add_vertex("C", 5); t.add_vertex("D", 10); t.add_vertex("G", 20); t.add_vertex("E", 15); t.add_vertex("H", 30); t.add_vertex("F", 17); cout < boolalpha;="" cout="">< t.num_vertices()="">< endl;="" cout="">< t.num_edges()="">< endl;="" cout="">< t.sum_weight()="">< endl;="" for(auto="" x="" :="" t.path_with_largest_weight()){="" cout="">< x="">< "="" ";="" }="" cout="">< endl;="" }="" tree.hpp="" #include=""> #include #include #include #include