2

Hello i am really new to programming and have to programm a C++ Code for separate chaining and for that i have to use a struct and a constructor called ADS_set.

My struct looks like this:

struct element {
 key_type key;
 size_type *nextElement = nullptr;
 Mode mode {Mode::free};
};

The constructor has to look like this:

ADS_set(){
table=new element * [N];
for(int i=0; i<N; i++)
{
  table[i].key=0;
  table[i].mode=Mode::free;
  table[i].nextElement = nullptr;
}
}

My question is how do i have to declare my table outside of ADS_set that it accepts all this lines. Is it an array or array of elements?

Merve
  • 65
  • 5

0 Answers0