/// Rotates a list by one place forward.
let rotate lst =
List.tail lst @ [List.head lst]
...
Haskell Combination and Permutation...
by https://www.google.com/accounts/o8/id?id=AItOawnKDqoH-UcpVbtsfwJBE19476rOzrIq9wU,
December 21, 2010 01:26,
No refactoring, tagged with permutations, f#, combinations
def prem(s,nx = [])
return nx.join if s.empty?
s.collect { |b| prem(s-[b],nx+[b]) }.flatten
...
Ruby Erlang Riddle for Rubists
Originally published at htt...
#!/usr/bin/python2.5
def permute(li):
"""Generate all permutations of a sequence
...
Python Computing permutations with...
by Leif Ryge,
October 22, 2008 04:16,
6 refactorings, tagged with recursion, generator, permutations, permutate
I suspect there is a better...
Note: code is actually F#.
...