tags:

views:

89

answers:

2

I have a list of objects. I need all possible permutations of those objects.

In C++, there's std::next_permutation(). I have been trying to find something in the .NET Framework, but came up dry.

What am I missing?

+5  A: 

I don't think it's built in to the framework but there's a good article on CodeProject with some samples

http://www.codeproject.com/KB/recipes/Combinatorics.aspx

StressChicken
I was just about to post the same article.
spinon
I'm not after a way to implement this. I thought it would be in the Framework. (That would be the very first time I come across something which is available in the C++ std lib but not in the .NET Framework.)
sbi
@sbi: Trust me, it's not in the framework.
Dan Tao
+1  A: 

I also think that there is no permutations() function included in the .NET Framework. But you could always go and implement it yourself...

...in that case you might find this post useful:

Fast permutation -> number -> permutation mapping algorithms

evermean