Why aren't we all speaking LISP now?

Alex Martelli aleaxit at yahoo.com
Fri May 11 18:38:20 EDT 2001


"bowman" <bowman at montana.com> wrote in message
news:5YRK6.68$5J2.1540 at newsfeed.slurp.net...
>
> "Tim Roberts" <timr at probo.com> wrote in message
> news:tcumfto5unpji5u109b8bctegnji4po3ap at 4ax.com...
> >
> > knew the list was going to be limited in size.  I KNOW I can write a
> > bubblesort or insertion sort and get it right.  I'd have to look up and
> > debug a quicksort or a heapsort.
>
> at least in C, my lookup of sorting ends with 'man qsort'. While ANSI does

So what happens when you have to sort a (linked) list -- you have
to pour it into an array to call qsort on it, then back into linked form?
Feels sort of expensive (sure, still O(N log N), but...).  If one works
with a lot of linked lists in C, mergesort is pretty nice, and the list
variant of quicksort not bad either in certain cases.  C++ does supply
such niceties (in its standard library), but C per se doesn't...


Alex






More information about the Python-list mailing list