If the observation type of CountMap has a total ordering (T : IComparable<T>), then one can define the Median and more generally the Quantile function.
For simplicity, we can probably omit the IComparable<T> requirement, and just order the keys by the default comparer. There can be an overload that takes a specific comparer if a different ordering is required.
If the observation type of
CountMaphas a total ordering (T : IComparable<T>), then one can define theMedianand more generally theQuantilefunction.For simplicity, we can probably omit the
IComparable<T>requirement, and just order the keys by the default comparer. There can be an overload that takes a specific comparer if a different ordering is required.