Bucket-sort

2 articles

dsa2 min read

Top K Frequent Elements

Return the K most frequent elements using a frequency map plus min-heap, or bucket sort for O(n) solution.

Read →