Sunday, January 11, 2009

Random samples and permutations (which terminate)

I am enjoying Jon Bentley's book. And well... I always made the same mistake he made for generating random samples and permutations (see Programming pearls: a sample of brilliance). Floyd's algorithms are pretty and elegant solution to the problem. Here you have a C++, STL implementation.

No comments:

Post a Comment