On Oct 3, Marcin 'Qrczak' Kowalczyk wrote:
> Eli Barzilay <eli_at_barzilay.org> writes:
>
> > (sort file-names
> > (lambda (f1 f2) (< (file-date f1) (file-date f2))))
> >
> > and
> >
> > (map cdr
> > (sort (map (lambda (f) (cons (file-date f) f)) file-names)
> > (lambda (p1) (< (car p1) (car p2)))))
> >
> > The scond version is doing half the number of FS accesses.
>
> Not half the number but 2*log(N) times less, where N is the number of
> elements to be sorted, assuming sorting takes N*log(N) comparisons.
(Yeah, sorry.)
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://www.barzilay.org/ Maze is Life!
Received on Mon Oct 02 2006 - 18:26:04 UTC