Boost logo

Boost Users :

Subject: Re: [Boost-users] Question on unordered_map
From: Daniel James (daniel_james_at_[hidden])
Date: 2009-10-15 11:14:09


2009/10/15 Arun Raghavan <bananasing_at_[hidden]>:
>
> 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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net