Question on unordered_map

15 Oct
2009
15 Oct
'09
2:34 p.m.
Hi, Do the underlying hashtable implementations of unordered_map/multimap store a size field (i.e. do they support a constant-time size function)? Same query about the load factor and bucket sizes. thanks. -b

15 Oct
15 Oct
3:14 p.m.
2009/10/15 Arun Raghavan
Do the underlying hashtable implementations of unordered_map/multimap store a size field (i.e. do they support a constant-time size function)? Same query about the load factor and bucket sizes.
Size is stored in a member variable, so it's just a member lookup. Load factor is calculated by dividing the size by the number of buckets, so it's constant time but a bit slower. Bucket size is o(n) where n is the size of the bucket. Daniel
5610
Age (days ago)
5610
Last active (days ago)
1 comments
2 participants
participants (2)
-
Arun Raghavan
-
Daniel James