Like set but allows duplicates, keeps sorted.
Real Life: Sorted list with repetitions allowed.
No user input.
Elements are inserted into a container.
Elements printed in sorted order, including duplicates.
• Elements can repeat
• Order is always sorted automatically
A multiset is similar to a set, but it allows duplicate values.
All elements are stored in sorted order automatically.
This is useful when repetitions matter.
1.Create a multiset.
2.Insert elements using insert().
3.Duplicates are allowed, so same value can be inserted multiple times.
4.Multiset automatically keeps elements sorted.
5.Traverse the multiset using an iterator.
6.Print all elements in order.