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


Are there any questions left?
New questions in the section Engineering
Sign up for the IQClass
Answers from experts with no ads!
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Made with love
This website uses cookies to make IQClass work for you. By using this site, you agree to our cookie policy

Pleased to see you again

IQClass unlocks the learning potential of every child
  • Master useful skills
  • Improve learning outcomes
  • Share your knowledge
Create an account
Sign in
Recover lost password
Or log in with

Create an account

IQClass unlocks the learning potential of every child
  • Master useful skills
  • Improve learning outcomes
  • Share your knowledge
Create an account
Sign Up
Or sign up with
By signing up, you agree to the Terms of use and Privacy policy.
Looking for an answer to a question you need help with?
you have баллов