🎉 October Learning Month — learn a new software term every day!
An interactive flashcard trainer for software engineering terms.

Fisher Yates

In plain terms

An algorithm to shuffle an array into a uniformly random order.

Going deeper

The Fisher-Yates shuffle swaps each element with a randomly chosen one from the remaining unshuffled portion, producing an unbiased permutation. It's the correct way to shuffle.

Under the hood

O(n) and provably uniform; naive shuffles introduce bias, a famous correctness pitfall.

Examples

Card shuffling, randomizing playlists, sampling, A/B test assignment.

Think of it like...

Like drawing names from a hat one at a time, each draw truly random from those left.

Feedback & Bug Report