From: Bill Kelly Date: 2002-08-10T04:30:48+09:00 Subject: Re: Coding challenge (on Ruby Garden) [long] From: "Christoph" [...] > Hm, these units tests are moving targets;-). I changed the > algorithm to cover this test case. I also fixed editing > mistake in the Unit tests ... Congrats! It passes all the tests... for now!!! ;-) Here's how it performed relative to a couple others from before that still pass all the tests: # chr (10 iterations) 3.204 (0.3204 per iter) nitems=60 # george (10 iterations) 40.638 (4.0638 per iter) nitems=60 # bwk (10 iterations) 78.503 (7.8503 per iter) nitems=60 Interestingly, though, although an order of magnitude faster than those competitors, it seems to have the same O() somehow? Because with nitems=70 george and bwk took "forever". With yours at 70 we have: # chr (10 iterations) 19.288 (1.9288 per iter) nitems=70 But with nitems=80, yours also took "forever". (I broke it after about a half hour still not finishing the 1st iteration.) I was kind of surprised by that . . . Regards, Bill