Originally posted by wysota
Or even a B-tree. The latter are used for database indexes, so you can say they are pretty fast
B-trees are fast because they require less IO operations, but they won't outrun a balanced binary tree, if it fits in the memory.
Originally posted by myfairlady
In the docs it is given that QMap is a value-based and QPtrDict is pointer-based, so does tht mean that QPtrDict is faster in searching ???
Which has faster lookup and why ???
QMap is value based (i.e. it holds copies of your objects), so every time you insert something it will make a copy. QPtrDict doesn't make copies, so insertions should be faster, but I don't see any reason why QMap should have lower lookup speed.
You could write a little benchmark to check which one is really faster.