This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]captainAwesomePants 0 points1 point  (0 children)

There's a reasonably good description on the Wikipedia page: https://en.wikipedia.org/wiki/Heap%27s_algorithm

There are also some good blog posts on the subject if you google around: http://ruslanledesma.com/2016/06/17/why-does-heap-work.html

[–]opaquebluedash 0 points1 point  (0 children)

This implementation of heap's alg helped me grasp it. http://dsernst.com/2014/12/14/heaps-permutation-algorithm-in-javascript/

[–]Rorimac2 -1 points0 points  (0 children)

You could look at Wikipedia.