File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Permutations

 
Layne Lund
Ranch Hand
Posts: 3061
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does Java have a method that generates the permutations of a given List? I'm interested in something similar to next_permutation() from the C++ <algorithm> header.

Layne
 
Yilmaz Mete
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think such a utility exists yet.
But should be simple to code.
 
Layne Lund
Ranch Hand
Posts: 3061
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After some more research, I found some examples on the web. I know I could come up with it on my own if I want to, but I was hoping there was something already available. This is probably one of the few instances where I found the standard C++ library has functionality that is missing from the Java API.

Layne
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic