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
//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
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started