|
|
On Tuesday 31 October 2006 19:51, Scott Aron Bloom wrote:
> Just hope the lists arent that long... thats a O(N^2) algorithm
>
> If the lists are sorted, you may want to consider just using the STL
> algorithm, if they are unsorted, you could presort, or convert 1 to a
> set, and then iterate and use the contains on the set. Then its down to
> a NlogN algorithm
>
> Scott
Another possibility might be to use QSets instead of QLists. QSet provides
methods like intersect() and subtract() and can be easily converted to and
from QLists. I don't know how expensive these operations are, though.
Regards,
Bernd
--
To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
"unsubscribe" in the subject or the body.
List archive and information: http://lists.trolltech.com/qt-interest/
|
|