Program to sort a 1d array.