Boost logo

Boost :

From: Pranam Lashkari (plashkari628_at_[hidden])
Date: 2021-04-25 08:38:41


On Sun, Apr 25, 2021 at 10:06 AM sayan chaudhuri via Boost <
boost_at_[hidden]> wrote:

>
> Dear Matseuz,
> The histogram implemented in boost gil uses an
> unordered map.Wont it have been better with an ordered map? Because the
> worst case time complexity is better in case of ordered maps.
>

The worst-case complexity of what, insertion, deletion, search? in the
general case, an unordered map performs better as it is hash bases while
maps are tree-based, so obviously, insertion and search operations are
constant time unless there are hash collisions in which case it becomes
constant + linear(bucket size). And in histogram specific to our case, we
have a very defined range of values, so I don't think there are going to be
collisions or at least not much of collisions.

It is also better to keep GIL specific discussion on the GIL channel rather
than the main boost channel.

-- 
Thank you,
Pranam Lashkari, https://lpranam.github.io/

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk