Re: elegance vs. 'quick and dirty': a Mathematica expression beauty contest
- To: mathgroup at yoda.physics.unc.edu
- Subject: Re: elegance vs. 'quick and dirty': a Mathematica expression beauty contest
- From: John Lee <lee at math.washington.edu>
- Date: Fri, 3 Apr 92 11:38:47 -0800
Here's a solution to the Flattening problem that I posted a while ago to sci.math.symbolic, but didn't get around to sending to this group. It's actually a slight variation on gaylord's solution #1, but it looks a little cleaner. In some simple timing tests, #2 was fastest (3.4 seconds for 1000 iterations on a DECStation 5000), my solution and #1 took about the same amount of time (5.5 seconds), while #3 took about 8.6 seconds. finallist = startlist //. {a___,{b__List},c___} :> {a,b,c} Jack Lee Dept. of Mathematics University of Washington