mirror of
https://github.com/theoludwig/programming-challenges.git
synced 2024-11-09 22:08:58 +01:00
37 lines
520 B
Markdown
37 lines
520 B
Markdown
# heap-algorithm
|
|
|
|
Created by [@theoludwig](https://github.com/theoludwig) on 8 November 2021.
|
|
|
|
## Instructions
|
|
|
|
Write a program that generates all possible unique permutations of a string.
|
|
|
|
The order of the generated permutations is important, see the example below.
|
|
|
|
## Source
|
|
|
|
- [Heap's Algorithm - Wikipedia](https://en.wikipedia.org/wiki/Heap%27s_algorithm)
|
|
|
|
## Examples
|
|
|
|
### Example 1
|
|
|
|
#### Input
|
|
|
|
```txt
|
|
abc
|
|
```
|
|
|
|
#### Output
|
|
|
|
```txt
|
|
abc
|
|
bac
|
|
cab
|
|
acb
|
|
bca
|
|
cba
|
|
```
|
|
|
|
See the `test` folder for examples of input/output.
|