← All problems
#36 Radix Sort Hard

Implement a radix sort algorithm that sorts an array of 32-bit unsigned integers on a GPU. The program should take an input array of unsigned integers and sort them in ascending order using the radix sort algorithm. The input parameter contains the unsorted array, and the sorted result should be stored in the output array.

Implementation Requirements

Example 1:

  Input:  [170, 45, 75, 90, 2, 802, 24, 66]
  Output: [2, 24, 45, 66, 75, 90, 170, 802]
  

Example 2:

  Input:  [1, 4, 1, 3, 555, 1000, 2]
  Output: [1, 1, 2, 3, 4, 555, 1000]
  

Constraints

Guided walkthrough coming soon. Below is the official starter signature in each language; the clickable line-by-line explanation hasn't been authored yet.
Problem text & starters from the official AlphaGPU/leetgpu-challenges. Solve it on leetgpu.com.