Fwd: [BOOST][GIL][Histogram]Ordered Maps in place of unordered maps
---------- Forwarded message ---------
From: sayan chaudhuri
On Sun, Apr 25, 2021 at 10:06 AM sayan chaudhuri via Boost < boost@lists.boost.org> 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/
participants (3)
-
Pranam Lashkari
-
sayan chaudhuri
-
Vinnie Falco