• Courses
  • Tutorials
  • DSA
  • Data Science
  • Web Tech
July 18, 2024 |127.7K Views

Write a program to print all permutations of a given string

Description
Discussion

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.

O(n*n!) Note that there are n! permutations and it requires O(n) time to print a permutation.

Write a program to print all permutations of a given string: https://www.geeksforgeeks.org/write-a-c-program-to-print-all-permutations-of-a-given-string/