Newsgroups: comp.lang.scheme
From: Eli Barzilay <e...@barzilay.org>
Date: 11 Jan 2002 19:59:18 -0500
Local: Fri, Jan 11 2002 7:59 pm
Subject: Re: Subsets of a list
George Caswell <tetsu...@maine.rr.com> writes: There is a really nice lesson here -- you have this fight over who's > > (define a (subs2 ys 10)) > ;Evaluation took 1760 mSec (0 in gc) 2469846 cells work, 1236201 env, 534 > bytes other > #<unspecified> > > (define a (combos ys 10)) > ;Evaluation took 2740 mSec (30 in gc) 675120 cells work, 4721385 env, 34 bytes > other > #<unspecified> > > (define a (subs ys 10)) > ;Evaluation took 1880 mSec (10 in gc) 2663988 cells work, 1242383 env, 34 > bytes other code runs faster, tweaking your code into something more and more complex, while Oleg wrote a version which is clearly superior in its clarity (as he shown it to be directly related to the definition). So, you must have tried his code too, getting to a conclusion that it | > (define a '(a b c d e f g h i j k l m n o p q r s t u v w x y z)) and it definitely looks like his solution beats the hell out of the The thing is that once you realize that the solution is functional, | > (time (begin (s6 a 8) #f)) clearly beating the rest... [I always wonder why does everyone teach dynamic programming with -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||