[Qt-interest] Online sorted structure

Pascal Patry iscy at invalidip.com
Tue Mar 24 18:09:24 CET 2009


On March 24, 2009 12:55:58 pm Andrea Franceschini wrote:
> Hi all,
> I'd like to have a sorted list which ordering is maintained for each
> insertion. I know that I could achieve a similar effect by using the
> keys of a QMap but it seems to me that the memory overhead (even if
> small) is unjustified for the sole purpose of having a list of keys
> sorted online.
>
> Is there any other way in which I can achieve this in linear space and
> log(n) time?

If you only use keys without values, use a set instead of a map.





More information about the Qt-interest-old mailing list