Skip to content

Instantly share code, notes, and snippets.

Created July 16, 2013 03:23
Show Gist options
  • Save anonymous/6005506 to your computer and use it in GitHub Desktop.
Save anonymous/6005506 to your computer and use it in GitHub Desktop.
public void permutate(String beginning, String input){
if(input.length() == 1){
System.out.println(beginning + input);
}
else
for(int i = 0; i < input.length(); i++){
permutate(beginning + input.charAt(i), input.substring(0,i) + input.substring(i + 1));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment