Permutation of a string in java using recursion

Tutorials Shared by the Internet Community


Permutation of a string in java using recursion

Find Permutation and Combination of a String , such type of questions can be asked in the written round of the major tech giants like Amazon.


  • Total Hits - 33095

  • Total Votes - 20 votes

  • Vote Up - 11 votes

  • Vote Down - 9 votes

  • Domain -

  • Category - JAVA/JAVA Misc

  • Submitted By - Java Hungry

  • Submitted on - 2014-04-02 06:19:56


Let us understand first , what we want to achieve . We want to write a function which prints all possible orderings of the characters in the string, in other words, print all permutations that use all the characters from the original string.
For example , given a string "sky" , our function should return

Output : "ysk","ksy","yks","kys","syk" and "sky"    More detail...

Broken  |   Save  |   Liked  |   Down

E-Books Store