prosyslab-classroom / cs348-information-security

62 stars 10 forks source link

[Question][Hw4] Set semantic #112

Closed john-mai-2605 closed 3 years ago

john-mai-2605 commented 3 years ago

Is there a way to pull out an element from a set randomly, without changing the set to another Data Structure? I read the Set documentation and seems like it is all deterministic.

ilchu commented 3 years ago

From what I could gather, it really is all deterministic, so we would have to cast it into array or list. More info here: https://stackoverflow.com/questions/5782932/how-can-i-randomly-select-an-element-in-ocaml

john-mai-2605 commented 3 years ago

Thank you. I will close the issue :).