Dan Luu personal blog

Why does Sattolo's algorithm produce a permutation with exactly one cycle?

I recently had a problem where part of the solution was to do a series of pointer accesses that would walk around a chunk of memory in pseudo-random order. Sattolo's algorithm provides a solution to this because it produces a permutation of a list with exactly one cycle, which guarantees that we will reach every…
Points
156
HN comments
38
Submissions
2
Cited by
0 commenters

Math & AlgorithmsSoftware Engineering2017

On Hacker News

SubmittedTitle on HNPointsComments
Aug 9, 2017Why does Sattolo's algorithm produce a permutation with exactly one cycle? by darwhy15618
Sep 15, 2020Sattolo's Algorithm (2017) by laybak10020

More from Dan Luu

All 102 posts →

Related posts from the same era