Expand description

Counts recurring elements from a provided iterable.

Its main purpose is to count elements in a iterable collection and provide related statistics. However it closely mimics the well known structure called hash bag or hash multiset.

More: https://en.wikipedia.org/wiki/Multiset

Complexity

MetricComplexity
InitializationO(n)
Memory usageO(k)
InsertionO(1)
Calculating the most popular elementsO(k)

where k - number of unique elements in the initializing series.

Inspiration

This structure was highly inspired by the Python Counter class:

https://docs.python.org/3/library/collections.html#collections.Counter

Structs

Counts recurring elements from a provided iterable.

Type Definitions

A faster but less safe version of Counter.