Back to all patterns

Heap / Bucket Sort

1 problems • Practice on LeetCode to earn credits

About This Pattern

Master the Heap / Bucket Sort pattern by practicing these problems organized by difficulty.Focus on the Key Signals - these are the indicators that tell you when to use this pattern.

Medium (1)

Top K Frequent Elements

Given an integer array, return the k most frequent elements.

Key Signals:

Top K elementsFrequency countingBetter than O(n log n) possible