Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help me with this hashtable copy constructor and assignment operator. I passed my own test cases but my professor's testing case keeps telling me I

image text in transcribedimage text in transcribedimage text in transcribed

Help me with this hashtable copy constructor and assignment operator. I passed my own test cases but my professor's testing case keeps telling me I have bugs. I cannot figure it out where. Here is my code for copy constructor and assignment as well as the put function it will use. Entry is another class object with private member key and data. Can anyone take a look and tell me where my implementation might go wrong?

6 #ifndef table h #define table h 9 #include "entry"h" 10 #include iostream 11 #include 12 #include 13 14 using namespace std; 15 16 typedef std: :vectortable; max t . get-max( ) ; this->table-new Wxl[max]; // WX1* temp t.get_table(); for(int i -0 iput(t.table[i][k].get_key),t.tableti][k].get_data)); //table[i].push_back (temp[i][k]); return *this; Table:: Table(const Table& t)f max-t.get_max table new Wxl[max]; / Wx1* temp t.get_table); for (int i = 0; i 12 #include 13 14 using namespace std; 15 16 typedef std: :vectortable; max t . get-max( ) ; this->table-new Wxl[max]; // WX1* temp t.get_table(); for(int i -0 iput(t.table[i][k].get_key),t.tableti][k].get_data)); //table[i].push_back (temp[i][k]); return *this; Table:: Table(const Table& t)f max-t.get_max table new Wxl[max]; / Wx1* temp t.get_table); for (int i = 0; i

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

Relational Database Design A Practical Approach

Authors: Marilyn Campbell

1st Edition

1587193175, 978-1587193170

More Books

Students also viewed these Databases questions