Sorting an array of length $n$ in $O(m+n)$ time
Use counting sort. In $O(n)$, count the number of elements of each value, and then in $O(m+n)$ go over the histogram and translate it to the sorted array.