I used Qmap many times but perhaps never used QHash. Now I'm reading about hash tables.
Is QMap a hash table?
I presume down there in a QHash we will find the ideas of Hash Maps. Should I say QHash is the implementation of a hash map (or hash table) data structure? Is QMap also the implementation of a hash table?
Can I use the terms map
and table
interchangeably?
No QMap is not a hash table. Per the documentation:
In other words it is a binary sort tree that uses the red-black tree algorithm to maintain balance. Meaning that searches will take O(logN) rather than O(1) as in the case of QHash.
It also means that QMap will keep the data sorted.
From the documentation you quoted:
QHash is a hash table. QMap is a binary sort tree using the red black tree algorithm.