samedi 9 février 2019

Selecting percentage of random elements in a C++ map

I have a C++ map: std::map <std::string, int>

I would like to pick p percentage of random elements from this map. Here p is dynamic. For example, 10% or 30% of randomly picked elements out of all elements of this map. Cannot use c++11.

What is the best way to do this?

Thank you.




Aucun commentaire:

Enregistrer un commentaire