Topic: Sequence container with fast random access and fast insertion/removal
Author: gianni@mariani.ws (Gianni Mariani)
Date: Mon, 30 Oct 2006 17:44:49 GMT Raw View
Martin Knoblauch Revuelta wrote:
> I've written a sequence container with O(log n) complexity for both
> random access and insertion/removal:
>
> http://sourceforge.net/projects/avl-array
>
> It was after posting to comp.lang.c++.moderated when I discovered this
> other group (comp.std.c++) and the fact that this subject has already
> been discussed years ago in "tree containers in STL". It was not the
> main subject there, but some people suggested creating something like
> this. Well, my idea was not so new after all :-)
>
> IMHO, a container like this would be very useful. What do you think?
> Is this (O(log n) complexity) anti-STL-spirit?
>
> Sorry for the partly/duplicated post.
Hi Martin,
This is very cool. I was about to say that this is eqivalent to
std::map<int,T> but that's not what this is at all. It seems like this
is certainly far better than std::deque and I would support it's use.
My humble vote would go to adding it.
Probably the best thing is to see if the boost people want to add it to
the boost library.
One potentially interesting application for this is in the "bring to
front" compression techniques or an LRU system.
Would it be easy to support a "splice" method ?
/G
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]