Remember to comment all your code carefully, and do not forget your Id box. Marks will be deducted for poor documentation. If you work in another programming environment outside of lab, make sure you check that your program works in the lab before the due date! 1.[60 marks] The data structures that we have covered in class are presented using a very basic implementation. Often, you will use one of these data structures as a starting point for a problem you need to solve. For this assignment you will take the binary search tree class that we discussed in class and add more functionality to it, as detailed below. The data you will store in the binary search tree relates to information about a collection of integers. You will need to keep track of the frequencies of each integer (how often it occurs in the input). This is to be done by modifying the tree; only a single copy of an integer should appear in the tree. Additionally, you must keep track of the depth of each node in the tree (remember, the root has depth 0). This functionality will need to be implemented either by modifying some methods in or adding some additional ones to the BST class definition. You will need to also write a driver program, called main(), that reads simple commands that test your binary search tree implementation. eSubmit will invoke main() and will provide input according to the following:
Get Free Quote!
274 Experts Online