Multiset / Bag Visualization

Element → Count | Add / Remove / Count / Most-Common

Controls

Enter an element and click an operation.

Multiset (each bar = element × its count)

multiset is empty — add an element

Operation Log

Statistics

0
Distinct
0
Total (with dups)
Mode
0
Max Count

Big-O Complexity

OperationAvgWorst
add(x)O(1)O(n)
remove(x)O(1)O(n)
count(x)O(1)O(n)
size()O(1)O(1)
distinct()O(1)O(1)
mostCommon(k)O(n log k)O(n log k)

Quick Fill