What is a numbers sorter? We have to follow the step to solve this problem, they are: Build a Priority_queue or max_heap, pq that stores elements and their frequencies. First you have to give id for each label tag ex: