开发者

How to permute a list of objects in C#?

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.

开发者_JAVA百科

What am I missing?


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜