Newsgroups: comp.lang.scheme
From: George Caswell <tetsu...@maine.rr.com>
Date: Fri, 11 Jan 2002 23:27:34 GMT
Local: Fri, Jan 11 2002 6:27 pm
Subject: Re: Subsets of a list
On 11 Jan 2002, John David Stone wrote:
> I used SUBS to find all the ten-element subsets of a twenty-element These are my results: ys is a 20 element set. subs2 is a variation on > set, in the same environment (Chez Scheme 6.1, Linux, 700MHz Pentium III) > where SUBSETS took 460 ms and COMBOS took 250 ms for the same task. SUBS > took 990 ms. subs that stores data differently. > (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 On my interpreter (SCM), subs and subs2 take less time, but use around 4 Is Chez Scheme in Debian? Listing for subs2 follows: (define (subs-base xs) (define (subs-expand xs sets) (define (subs2 xs n) ---GEC 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.
| ||||||||||||||