Created
May 9, 2014 09:05
-
-
Save maxfunke/3fd53ff731fb644c6724 to your computer and use it in GitHub Desktop.
recursiv subset (different length, same order)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void recSubsets(String soFar, String rest) { | |
if (rest.equals("")) { | |
System.out.println(soFar); | |
} else { | |
recSubsets(soFar + rest.charAt(0), rest.substring(1)); | |
recSubsets(soFar, rest.substring(1)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment