Need help with a program to search to sort elements in an array.(increasing or decreasing order)