Fisher–Yates/Knuth shuffle (General Permutations Generating Random Permutations)

From Algorithm Wiki
Jump to navigation Jump to search

Time Complexity

$O(n^{2})$

Space Complexity

$O(n)$ words

(Need to keep track of which elements have been struck out already)

Description

Approximate?

Exact

Randomized?

Yes, ??

Model of Computation

Word RAM

Year

1938

Reference

https://www.worldcat.org/title/statistical-tables-for-biological-agricultural-and-medical-research/oclc/14222135