[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: vectors vs. lists
From: Adriaan de Groot <adridg () cs ! kun ! nl>
Date: 2004-02-19 12:02:09
Message-ID: 200402191302.10738.adridg () cs ! kun ! nl
[Download RAW message or body]
On Thursday 19 February 2004 12:49, Werner Trobin wrote:
> On Thursday 19 February 2004 10:46, Marc Mutz wrote:
> > It's really funny how STL-trained people default to std::vector<> in all
> > their code, and you see std::list<> only very rarely, but you see
> > QValueList used as a default in KDE/Qt, and in ways that involve
> > indexing (O(n)! vs. O(1) in QVV). This loop, btw,:
>
> While I agree with all of your points this O(n^2) statement is not true.
> Please check at() and especially locate() in QGList.
The Qt 3.2 docs say "uses a linear search and may be slow" - although I seem
to remember that at some point the list had a "current item" and that it used
linear search from the start, the end, or the current item depending on what
was closest.
--
pub 1024D/FEA2A3FE 2002-06-18 Adriaan de Groot <groot@kde.org>
Would you like a freem?
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic