Buckets [mp]
Micro pattern¶
Description¶
Map values or derived properties into indexed groups for independent processing.
Problems¶
Hash buckets¶
Map hashed keys to slots and resolve collisions within each slot.
- Hash table (DSA)
Constraint buckets¶
Maintain separate sets for independent constraint regions.
- 36. Valid Sudoku (Top Easy)
Frequency buckets¶
Use occurrence counts or bounded values as direct group indices.
- 347. Top K Frequent Elements (Top Medium)
- Counting sort (DSA)
- 740. Delete and Earn (Dynamic Programming)
Range and digit buckets¶
Place values into ordered ranges or digit groups before processing them.
- Bucket sort (DSA)
- LSD radix sort (DSA)