I'll explain when to prefer sets over sorted vectors. If you do many insertions and searches, set is better. For static data with many searches, sort once and use binary_search. You'll use partial_sort when you only need the top elements.
It's faster than full sort: versus . For counting, maps give average time. Use algorithms when you need to operate on ranges.