Write a Java/Scala program to sort an array of positive integers of a given array, in the sorted array the value of the first element should be maximum, second value should be minimum value, third should be second maximum, fourth second be second minimum and so on.
Sample Pattern:
[100, 10, 90, 20, 80, 30, 70, 40, 60, 50]
Input:
Original Array
[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
Output:
New Array
[100, 10, 90, 20, 80, 30, 70, 40, 60, 50]
Published By : Jaivik Shah