Printing all Permutations of a String – C Programming Tutorial

In this c programming tutorial we are going to see a c program to print all permutations of a given string. Now let’s see what is a permutation.

A permutation, also called an arrangement number or order, is a rearrangement of the elements of an ordered list S into a one-to-one correspondence with S itself. A string of length n has n! permutation. Source: Mathword

Below are the permutations of string CBA.
Algorithm Paradigm: Backtracking
Time Complexity: O(n*n!)
Please write comments if you find the above codes/algorithms incorrect, or find other ways to solve the same problem.

 Output :
all permutation of string

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.