Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hello, I am struggling with an assignment that is due In a couple of days, This

ID: 3570160 • Letter: H

Question

Hello, I am struggling with an assignment that is due In a couple of days, This Needs to be in C++ and If you could write comments off to the side so I can learn and understand what is being done, I am still fairly new to programming and I am struggling through this at the moment.

Implement the 3-tree ADT. It Should be a generic ADT that can accept any type of data. Your ADT should include appropriate error checking that uses try-catch blocks to throw/catch exceptions.

Populate your 3-tree with data using a plain text file. This necessitates that you must provide some method to read data in from a file and provide appropriate error checking.

Implement both depth-first search and breadth-first search for your 3-tree ADT. Demonstrate your ADT with an appropriate driver program. The result will be one of the two options:

If the search item was not found in the 3-tree, output that is was not found.

If the search item was found, output the complete path(root to node) of where that value is found in the 3-tree.

Include in your depth first search and your breadth first search routines the option to count the number of comparisons used in each search. If this option is enabled bt the user, the number of comparisons required should be included in the output to the user.

Please try to implement as much as possible, I will rate well for answers that completely answer this question.

Explanation / Answer

#include #include #include using namespace std; # define max 10 typedef struct list { int data; struct list *next; }node_type; node_type *ptr[max],*root[max],*temp[max]; class Dictionary { public: int index; Dictionary(); void insert(int); void search(int); void delete_ele(int); }; Dictionary::Dictionary() { index=-1; for(int i=0;idata=key; if(root[index]==NULL) { root[index]=ptr[index]; root[index]->next=NULL; temp[index]=ptr[index]; } else { temp[index]=root[index]; while(temp[index]->next!=NULL) temp[index]=temp[index]->next; temp[index]->next=ptr[index]; } } void Dictionary::search(int key) { int flag=0; index=int(key%max); temp[index]=root[index]; while(temp[index]!=NULL) { if(temp[index]->data==key) { coutnext=temp[index]->next; cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote