That won't be efficient memorywise since the size of the result array is dependant on the largest value in the array of values.
Consider sorting an array of 2 large integers {65000,30000}. To sort this array, the result array will be initialized with 65000 elements. Very inefficient.