home
algorithm
runtime
variations
sources
{AGRTMLOIH}
{HIOLMTRGA}
{ALGORITHM}
The following is a description of the randomized algorithm in pseudocode:
while not sorted (deck): shuffle deck
An implementation in C:
An implementation in Python: