Shared Tutorials

Tutorials Shared by the Internet Community

Advertisements

  Top Tutorials     New Tutorials     Submit     Login     Register  

Tutorial Basic 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-recursion-in-java.html
  • Total Hits: 8690

  • Average Rating :
    Tutorial RatingTutorial RatingTutorial RatingTutorial RatingTutorial RatingTutorial Rating

  •  

  • Total Votes: 8 votes

  • Average Rating: 3.75 out of  5

  • Category: JAVA/Misc

  • 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"

Rating Detail

 Stars  Percentage  Total Vote
 One star  Vote LeftVote MiddleVote Right 12.5%  1
 Two starsTwo star  Vote LeftVote MiddleVote Right 12.5%  1
 Three starsThree starsThree stars  Vote LeftVote MiddleVote Right 12.5%  1
 Four starsFour starsFour starsFour stars  Vote LeftVote MiddleVote Right 12.5%  1
 Five starsFive starsFive starsFive starsFive stars  Vote LeftVote MiddleVote Right 50%  4

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