Bag - sellout/data-structure-zoo GitHub Wiki

A bag, also known as a multiset, is an unordered container. It provides the operations [chop](/sellout/data-structure-zoo/wiki/chop), [merge](/sellout/data-structure-zoo/wiki/merge), [peek](/sellout/data-structure-zoo/wiki/peek), [pop!](/sellout/data-structure-zoo/wiki/pop!), and [push](/sellout/data-structure-zoo/wiki/push). [peek](/sellout/data-structure-zoo/wiki/peek) on a bag can return any item in the container, but repeated calls to [peek](/sellout/data-structure-zoo/wiki/peek) on the same container must return the same item, and calls to [chop](/sellout/data-structure-zoo/wiki/chop) on that container must remove the item returned by [peek](/sellout/data-structure-zoo/wiki/peek).