[Interest] initialising a dictionary-type container instance with a static table?

René J.V. Bertin rjvbertin at gmail.com
Mon Jan 2 15:47:40 CET 2017


On Monday January 02 2017 16:37:50 Konstantin Shegunov wrote:

> The remark is relevant for "larger" sets of data. For micro maps it
> probably doesn't matter.

That seemed (and seems) evident.

> Anyway, QMap is a balanced binary tree, so
> inserting items sorted by key sequentially would cause it to rebalance
> itself (i.e. insertion is with log(n) worst complexity).

And that seems surprising, one could expect it to be more efficient to add items sequentially to a list that would maintain a sequential order anyway. But I'll take your word for it, I'm not a computer scientist by any kind of formal training :)

Cheers,
R.



More information about the Interest mailing list