On Fri, Sep 14, 2007 at 03:44:50PM +0200, Helge Hafting wrote:
> Alfredo Braunstein wrote:
> >>>
> >>>We have O(n) insertions/deletions like std::vector, std::list speed is
> >>>O(1)
> >>>
> >>We use vector as the container for list::iterator not for the Paragraph
> >>itself. insertion/delet
Alfredo Braunstein wrote:
We have O(n) insertions/deletions like std::vector, std::list speed is O(1)
We use vector as the container for list::iterator not for the Paragraph
itself. insertion/deletion of an iterator in a vector is cheap (fixed
size element) so O(n) is OK. Insertion/delet
Jean-Marc Lasgouttes wrote:
"Alfredo Braunstein" <[EMAIL PROTECTED]> writes:
Both I guess. That being said, I am not religious about that, you can
get rid of it if you find a proper replacement AFAIAC; but I don't think
there is a need to optimize anything here. There is a lot more
inefficient
"Alfredo Braunstein" <[EMAIL PROTECTED]> writes:
>> Both I guess. That being said, I am not religious about that, you can
>> get rid of it if you find a proper replacement AFAIAC; but I don't think
>> there is a need to optimize anything here. There is a lot more
>> inefficient stuff in the source
Oops, sorry Abdel, I forgot to send to the list.
> > Why? RandomAccessList::iterator is a std::list::iterator...
>
> Right but operator[] is fast. There was a fast iterator version once
The code is full std::advance(pit, something) or boost::next(pit,
something) that is currently O(n). That's why