# All the permutations of a given string

**URL:** https://discourse.processing.org/t/all-the-permutations-of-a-given-string/21172
**Category:** Coding Questions
**Created:** [May 22, 2020, 5:27pm UTC](https://discourse.processing.org/t/all-the-permutations-of-a-given-string/21172 "2020-05-22T17:27:49Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![paulstgeorge](https://avatars.discourse-cdn.com/v4/letter/p/53a042/32.png) [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)
#### Post date: [May 22, 2020, 5:27pm UTC](https://discourse.processing.org/t/all-the-permutations-of-a-given-string/21172/1 "2020-05-22T17:27:49Z")

</div>

Is there a way (in Processing) to find all the permutations of a given string? To be worthwhile, I think the string needs to be at least six characters long.

This could be a candidate for \<[http://www.rosettacode.org/wiki/Rosetta\_Code](http://www.rosettacode.org/wiki/Rosetta_Code)\>. I have found solutions in C++, C, Java, Python, C#, and PHP, but not Processing.

#Heap’s algorithm

---

<div class="post-metadata">

### Author: ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)
#### Post date: [May 22, 2020, 11:07pm UTC](https://discourse.processing.org/t/all-the-permutations-of-a-given-string/21172/2 "2020-05-22T23:07:56Z")

</div>

Hi,

Actually, Processing is written as a Java library so there is no “Processing” like version of a code because it’s built on Java.

The nice thing with Processing is that you can display visually how an algorithm works.

This is a similar topic on which I worked before with the [Arcane Algorithm Archive](https://www.algorithm-archive.org/) on sorting algorithms :

> <https://github.com/algorithm-archivists/algorithm-archive/pull/436>
