Question: c++ fill in the areas between //code starts here and //code ends here #include using namespace std; //The class my_pair which stores two values of

c++ fill in the areas between //code starts here and //code ends here

#include using namespace std;

//The class my_pair which stores two values of different types referred to as value1 and value2 //Your code starts here

//Your code ends here class my_pair { //Your code starts here

//Your code ends here

public: //Your code starts here

//Your code ends here

T get_value1() { return this->value1; } U get_value2() { return this->value2; } };

//The class node implements a linked list of pairs template class node { my_pair* value; node* next;

public: //Creates a new node node(T value1, U value2) { //Your code starts here

//Your code ends here } //Add a new pair at the end of the list void add(T value1, U value2) { //Your code starts here

//Your code ends here } //Find the value2 corresponding to the value1 passed as parameter T find_value1(U value2) { //Your code starts here

//Your code ends here } //Find the value1 corresponding to the value2 passed as parameter U find_value2(T value1) { //Your code starts here

//Your code ends here }

void print() { node* curr = this; while (curr != nullptr) { cout << curr->value->get_value1() << "->" << curr->value->get_value2() << endl; curr = curr->next; } } }; //After

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!