Write a C++ program that implements a binary search tree (BST) to manage a numbe
ID: 3573301 • Letter: W
Question
Write a C++ program that implements a binary search tree (BST) to manage a number of integer items with different priorities. In order to do so, you will need to maintain a queue as an item in the tree. Each queue item is an integer. All items in a given queue will have the same priority. As a new item with a user-specified priority comes in, it should be enqueued in the queue with items of that priority A new queue may need to created in case a queue with that priority does not exist. Use dynamic memory to manage nodes in the queue and BST Absolutely no global variables anywhere in your code! Implement the following: Constructor Destructor overloaded copy constructor overloaded assignment operator Overloaded "=="operator to check if two trees are equal. A tree t1 is equal to t2 if for every queue in t1, a corresponding queue with the same priority exists in t2 with the same set of elements (the order of the elements in the queue d not matter) Overloaded "Explanation / Answer
/* * C++ Program To Implement BST */ # include # include using namespace std; /* * Node Declaration */ struct node { int info; struct node *left; struct node *right; }*root; /* * Class Declaration */ class BST { public: void find(int, node **, node **); void insert(int); void del(int); void case_a(node *,node *); void case_b(node *,node *); void case_c(node *,node *); void preorder(node *); void inorder(node *); void postorder(node *); void display(node *, int); BST() { root = NULL; } }; /* * Main Contains Menu */ int main() { int choice, num; BST bst; node *temp; while (1) { coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.