Controls
Enter an element and click an operation.
Multiset (each bar = element × its count)
multiset is empty — add an element
Element → Count | Add / Remove / Count / Most-Common
| Operation | Avg | Worst |
|---|---|---|
| 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) |