Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Permutations

 
Layne Lund
Ranch Hand
Posts: 3061
  • 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
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic