spacesaving v0.0.1 Spacesaving
Summary
Functions
Initialize the state
Add the item, which should be an atom or string to the state
Get the top k counts as a descending sorted key list
Functions
Add the item, which should be an atom or string to the state
Examples
iex> Spacesaving.init(2) |> Spacesaving.push(:foo) |> Spacesaving.push(:bar)
{%{foo: 1, bar: 1}, 2}
iex> Spacesaving.init(2) |> Spacesaving.push(:foo) |> Spacesaving.push(:foo) |> Spacesaving.push(:bar) |> Spacesaving.push(:baz)
{%{foo: 2, baz: 2}, 2}