From: Adriano Mitre Date: 2009-07-27T06:40:46+09:00 Subject: Re: cartesian product of arrays Nanyang Zhan wrote: > well, then can anyone tell me which one is the best? Unfortunately, these methods use too much memory, storing the whole cartesian product Array in memory even its elements are needed only one at a time. A nicer alternative is the Cartesian module: "The Cartesian module provide methods for the calculation of the cartesian producted between two enumberable objects. It can also be easily mixed in into any enumberable class, i.e. any class with Enumerable module mixed in." The Cartesian module is available at http://rubyforge.org/projects/cartesian/ -- Posted via http://www.ruby-forum.com/.