Skip to content

Latest commit

 

History

History

permutations

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Generate all permutations of a string

Given a string with all distinct characters, the task is to generate all permutations of the string. For a n-letter string, there should be n! strings as output. For repeating characters, there are corresponding duplicates.

An example of the program: Input: abc

Output:

  1. abc
  2. acb
  3. bac
  4. bca
  5. cba
  6. cab

The following image shows the description of above permutations: