• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Wanted: Help translating From C# lambdas to Java 8 lambdas to Implement function GetPermutations

 
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to find all the permutations of a set of strings.
I did a google search for java and found some examples that seem to work: http://stackoverflow.com/questions/20906214/permutation-algorithm-for-array-of-integers-in-java

However, I found this cool C# code (below) that used lambdas to do the job in much less code! Now that Java 8 has lambdas, is there a nicer compact way to code this in Java 8 similar to the approach taken by C# below?
It seems to me we should have some java counterpart to the selectMany function that would accept some lambdas to implement a filter like C# does.

Thanks
Siegfried

 
reply
    Bookmark Topic Watch Topic
  • New Topic