The Computer Science Department would like to decide which courses to offer for the next semester and would like to offer only the courses that are in demand by thestudents. Write a program to allow the students to input the courses that they would like to take the next semester. The first time a course is submitted by a student,the course comes into existence and a counter for the course is set to 1 (showing that one student is interesting in taking the course). If the course already existsand a student would like for the course to be offered, the counter for the course is incremented. Display the course numbers (from smallest to largest) withcorresponding counters. Remove the courses with only one student interested in taking the course. Display the course numbers (from smallest to largest) withcorresponding counters after courses with one interested student have been deleted.Programming Guidelines:Use a binary search tree to store the information on the courses. Use the appropriate binary tree traversal that will give you the correct output. If there are morethan 5 courses requested.Use the following definition for the binary search tree:typedef int ElementType;class node{friend class BinarySearchTree;private:ElementType data;node * leftchild;node * rightchild;};class BinarySearchTree{public:BinarySearchTree();bool empty(); // return true if the tree is empty, otherwise return falsebool Insert(ElementType x);//insert a value xbool IsThere (ElementType x);//return true if x is in the tree, otherwise return falsevoid Delete(ElementType x); //if value x is in the tree, remove xvoid Display();// Display the data values stored from smallest to largestprivate:node * root;//pointer to the roor node};Sample input:285280163165476365163280280165365365165280476163163385Sample output:List of all courses:163 – 4165 – 3280 – 4285 – 1365 – 3385 – 1476 – 2List of courses more than one student interested:163 – 4165 – 3280 – 4365 – 3476 – 2
-
Engineering 2022-05-15 19:04:59