Re: An Applied Algorithmic Activity:

new topic     » goto parent     » topic index » view thread      » older message » newer message

> is this a function - which is from Jiri Babor - which might be helpful
> for you?:
> 
> function shuffle(sequence s)
>     object temp
>     integer j
> 
>     for i = length(s) to 2 by -1 do
>         j = rand(i)
>         temp = s[j]
>         s[j] = s[i]
>         s[i] = temp
>     end for
>     return s
> end function

Unfortunately no, because of the randomness in it. The thing needs to
be reproducible again.

-- 
MrTrick

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu