[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-freeqt
Subject:    Re: [freeqt] QVector
From:       Andrew J Bromage <Andrew.Bromage () its ! monash ! edu ! au>
Date:       2000-08-18 3:17:57
[Download RAW message or body]

G'day all.

On Thu, Aug 17, 2000 at 08:06:27PM +0100, Nick Huxley wrote:

> I have done most of QVector bar the QStream stuff that I don't really
> understand and sort and search.
> 
> Search is a binary search and I would image sort would be a quick sort.

That's what Qt does (it actually calls the system qsort(), which is a
hack in itself; the comparison function requires a global variable, which
is not thread safe), but that's not _necessarily_ the best idea.  It
might be better, for example, to use a stable sort, but I don't know how
important stability is.

> Before I leap into coding this stuff is there any LGPLed code for a quick
> sort rather than me re-inventing the wheel again.

I've sent you privately the qsort() source from glibc-pre2.1.  If you'd
like some code for merge sort, I'd be very happy to provide some.  Also
check out your STL headers if you're using g++, (I found it in
/usr/include/g++-3/stl_algo.h on my Debian box) for some sort code which
is licensed under terms equivalent to the MIT licence.

Cheers,
Andrew Bromage

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic