Question: Please fix my Randomize method but dont use any AI , because trust me I tried and it DID NOT WORKKK Your randomize method does

Please fix my Randomize method but dont use any AI, because trust me I tried and it DID NOT WORKKK Your randomize method does not have compilation errors. Your program should produce: After randomizing, data member bins is 2,2,1,21,1,1,2(this output is desired)------------------------------------------------------------------------------------------------ Your program produced: After randomizing, data member bins is 2,2,2,11,1,2,1(this output is wrong)
```
void SortGame::randomize(){
vector temp;
for (int i =0; i numDiffElms; ++i){
temp.insert(temp.end(), bins[i].begin(), bins[i].end());
}
random_device rd;
mt19937 gen(rd());
shuffle(temp.begin(), temp.end(), gen);
int idx =0;
for (int i =0; i numDiffElms; ++i){
for (int j =0; j capacity; ++j){
bins[i][j]= temp[idx++];
}
}
}
```
Please fix my Randomize method but dont use any

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 Programming Questions!