Permutation of a string in java using recursion

Advertisements

  Top Tutorials     New Tutorials     Submit     Login     Register  

Tutorial Detail

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.
http://javahungry.blogspot.com/2014/03/algorithm-to-find-permutations-of-string-using-recu...
  • Total Hits: 4476

  • Average Rating :
    URL RatingURL RatingURL RatingURL RatingURL Rating

  •  

  • Total Votes: 0 votes

  • Category: JAVA/JAVA Misc

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

  • Submitted By: Java Hungry

  • Set as Favorite

Description:

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...

Rating Detail

 Stars  Percentage  Total Vote
 One star  Vote LeftVote MiddleVote Right 0%  0
 Two starsTwo star  Vote LeftVote MiddleVote Right 0%  0
 Three starsThree starsThree stars  Vote LeftVote MiddleVote Right 0%  0
 Four starsFour starsFour starsFour stars  Vote LeftVote MiddleVote Right 0%  0
 Five starsFive starsFive starsFive starsFive stars  Vote LeftVote MiddleVote Right 0%  0

Caste Your Vote

 Rating  Selection  Guidelines
 Poor:     Very disappointing, useless.
 Fair:     Below average, disappointing but not useless.
 Good:     About average in its class.
 Very Good:     Above average for its category.
 Excellent:     One of the best Tutorials in its category.





Advertisements
Advertisements