My walkthrough without spoilers for No repeats please and Heap's algorithem

So finally I managed to create a working Heaps algorithm. After working on in for 5 days, only reading pseudo code and explanations on Heap’s algorithm, I wanted to share my steps with those who are still bamboozled as I am :slight_smile:

So:
_1 Try to understand what it does in 3 - 4 letters string:
#2 read the pseudo code in fCC hint and Wikipedias entry.
#3 Create a table, where each row represents one execution, and each column represents the permutated array, the position of the current charachter, the charachters being swapped and the used charachters.
#4Translate into code :slight_smile: Hint - I managed to work mine with the Wikipedia’s example after failing the fCC one. For some reason it worked better with reducing the current charachter rather than increasing the increment.

Good Luck!

1 Like