ranking Sort Sort   |   date Sort Sort   |   member Sort Sort
Syndication

11
Date Submitted Wed. Oct. 11th, 2006 2:41 PM
Revision 1
Beginner nil_ptr
Tags permutations | permute | python
Comments 1 comments
This is snippet of code solves the interesting (and specialized) problem of generating all permutations of a list. I hope you like recursion. For exmaple:

permute( [0,1,2] )

would return

[[0,1,2],[0,2,1],[1,0,2],[1,2,0],[2,0,1],[2,1,0]]