Jump to content
  • Advertisement
Sign in to follow this  
xxx_shinobi

Algorithm for nPk permutations ?

This topic is 4444 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello. I really need some algorithm for finding all nPk permutations (ordered sub-sets with lenght = k) Number of such permutations is n!/(n-k)! Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
If programming in C++, you can use the std::next_permutation and std::prev_permutation functions. The source code is available (in the <algorithm> header) in case you want to see the implementation (and thus the algorithm).

Share this post


Link to post
Share on other sites
Quote:
Original post by Fruny
If programming in C++, you can use the std::next_permutation and std::prev_permutation functions. The source code is available (in the <algorithm> header) in case you want to see the implementation (and thus the algorithm).



Is there something in .NET platform for nPk ?

Share this post


Link to post
Share on other sites
Quote:
Original post by xxx_shinobi
Is there something in .NET platform for nPk ?


I don't know. I doubt it. Check the documentation.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!