Optimal time and space vector class

Thomas Holenstein tholenst@iiic.ethz.ch
Thu Apr 13 08:21:00 GMT 2000


Hello,

I recently implemented (nearly finished) a vector class for c++.
The class implements all major operations (push_back, pop_back, 
operator[], etc.) in _worst_case_ O(1).

It is based on a paper by Brodnik, Carlsson, Demaine, Munro and
Sedgewick.

It uses optimal Space too, meaning that the wasted space is always 
O(sqrt(n)), even if you shrink the array using pop_back() or erase().

Is it a good idea, to include this class in libstdc++? I think 
it would be good if the user can choose, which class he wants.
The class had to be updated for your coding standards etc., but this
would be quite easy.

What do you think?

Thomas


More information about the Libstdc++ mailing list