Collection Permutations/Combinations code?

Joshua 'Schwa' Gargus schwa at cc.gatech.edu
Fri May 23 03:30:05 UTC 2003


Does anyone have code that does something like:

aCollection choose: 3 do: [:array | ...]

where each possible unordered collection of 3 elements (ie:
"n-choose-k", where n is the size of aCollection and k is here 3) is
chosen from aCollection and passed as the argument to the block?

Thanks,
Joshua



More information about the Squeak-dev mailing list