import { shuffle } from "https://deno.land/x/proc@0.22.1/tools/deps/proc.ts";
Performs an in-place shuffle of an array in linear time.
This function uses the Fisher-Yates (also known as Knuth) shuffle algorithm to rearrange
the elements in the array in a random order. The shuffle is performed in-place, meaning
that it modifies the original array instead of creating a new one. The time complexity of
the algorithm is O(n)
, where n
is the number of elements in the array.
Parameters
items: T[]