August 27, 2024

P25 - Generate a random permutation of the elements of a list.

Hint: Use the solution of problem P23.

Example:

scala

scala> randomPermute(List('a, 'b, 'c, 'd, 'e, 'f))
res0: List[Symbol] = List('b, 'a, 'd, 'c, 'e, 'f)
Be first to comment
Leave a reply