From: Ryan Davis Date: 2007-07-23T15:48:41+09:00 Subject: Re: array permutations On Jul 22, 2007, at 21:52 , Alex Ciarlillo wrote: > The other day I ran into a problem where I needed all the permutations > of a given array. I knew I had covered this in some of my CS > classes but > couldn't come up with the algorithm at first. I figured it out on the > drive home from work and decided to rubify it and add it as a > method to > the array class. This is what I came up with and was just wondering if > anyone else had a cleaner or more effecient way of accomplishing this. The one thing I learned in Algs is someone has invented/implemented/ tested it before me: http://rubygarden.org/Ruby/page/show/ArrayPermute Please use google.