Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books

Students also viewed these Databases questions

Question

What is the average transaction amount for Montana (MT)?

Answered: 1 week ago