vendredi 11 novembre 2022

How to pick a random number from a collection that doesn't support indexing?

I have a variable of a customly-written collection based on BTreeMap. The keys are GUID-s and the values are some structs.

How will I pick a random element from a said collection based on a random number that's been generated somehow or obtained from an external source?




Aucun commentaire:

Enregistrer un commentaire