i want to implement a container, which contains maximal 20 Solutions. If the container contains 20 Solutions any Solution that is added is only accepted if its
1) new_value < worst value in the Container
2) if new_value is already in the container (and 1) holds) then memcmp(new_assignment, assigment, assignment_size) != 0
Then the worst solutions is deleted. (Including the int array) the assignment_size is for all Solutions the same.
struct Solution {
double value;
int *assignment;
int assigment_size;
};
What is the easiest way to implement this structure? Can you use some container of the STL?