DEV Community

Discussion on: What's a function you've used/wrote that brought you joy?

Collapse
 
edwardloveall profile image
Edward Loveall

If you want to create permutations, most algorithms are recursive. That means if you only want the 10,000th permutation you have to calculate the 9999 permutations before it. I was interested in calculating random-access permutations so every permutation calculation takes the same amount of time. So I wrote an algorithm and wrote up the process here.