Navigation
Synopsis Compute all permutations of a list.
Function set[list[&T]] permutations(list[&T] lst)
Usage import List;
Examples
rascal>import List;
ok
rascal>permutations([1,2,3]);
set[list[int]]: {
  [1,3,2],
  [1,2,3],
  [3,1,2],
  [2,3,1],
  [2,1,3],
  [3,2,1]
}

Questions
Question [1]. How many permutations has a list of N elements:




Question [2].
The type of permutations(["Bruno", "Grapefruit", "Jabba the Hut"]) is

Question [3].
size(permutations([11, 3])) == 

Question [4].
permutations([]) == 



Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.