[erlang-questions] Swap 2 elements within a list a la Erlang ?

Jason Dusek <>
Sun Jun 10 04:44:45 CEST 2007


On 6/9/07, Andreas Bakurov <> wrote:
> I am new to Erlang and face a lot of  dilemmas...I have implemented
> Knuth's or Fisher-Yates shuffle in Erlang...

A little research just now suggests that Fisher-Yates is well suited
for language that allow destructive updates -- not functional
languages. There's a good substitute posted here:

    http://wiki.trapexit.org/index.php/RandomShuffle

-- 
_jsn



More information about the erlang-questions mailing list