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

List:       kde-core-devel
Subject:    Re: vectors vs. lists
From:       Werner Trobin <trobin () kde ! org>
Date:       2004-02-19 11:49:39
Message-ID: 200402191249.39610.trobin () kde ! org
[Download RAW message or body]

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,:
> 
> for ( int i = 0 ; i < list.count() ; ++i )
>    doSomethingWith( list[i] );
> 
> is O(n^2). Whereas these:

While I agree with all of your points this O(n^2) statement is not true. 
Please check at() and especially locate() in QGList.

Ciao,
Werner
[prev in list] [next in list] [prev in thread] [next in thread] 

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