Given an array arr[] of N distinct numbers, the task is to sort all even-placed numbers in increasing and odd-place numbers in decreasing order. The modified array should contain all sorted even-placed numbers followed by reverse sorted odd-placed numbers.
Note that the first element is considered as even because of its index 0.
Example 1:
Input: N = 8
arr[] = {0, 1, 2, 3, 4, 5, 6, 7}
Output: 0 2 4 6 7 5 3 1
Explanation: 
Even-place elements : 0, 2, 4, 6
Odd-place elements : 1, 3, 5, 7
Even-place elements in increasing order : 
0, 2, 4, 6
Odd-Place elements in decreasing order : 
7, 5, 3, 1
Example 2:
Input: N = 9
arr[] = {3, 1, 2, 4, 5, 9, 13, 14, 12}
Output: 2 3 5 12 13 14 9 4 1
Explanation: 
Even-place elements : 3, 2, 5, 13, 12
Odd-place elements : 1, 4, 9, 14
Even-place elements in increasing order : 
2, 3, 5, 12, 13
Odd-Place elements in decreasing order : 
14, 9, 4, 1
Your Task:
This is a function problem. You don't need to take any input, as it is already accomplished by the driver code. You just need to complete the function bitonicGenerator() that takes array arr and integer N as parameters and modify the array according to the above condition.
Expected Time Complexity: O(NlogN).
Expected Auxiliary Space: O(N).
 
Constraints:
1 ≤ N ≤ 10^{5}

Difficulty: EASY
Tags: Sorting

Data structures
Skill types: Sorting

Data structures
Expected Time Complexity: O(NlogN).
Expected Auxiliary Space: O(N).

Starter code:
#User function Template for python3


class Solution:
    def bitonicGenerator(self, arr, n):
        # Your code goes here


Solutions:
class Solution:

	def bitonicGenerator(self, arr, n):
		a = []
		for i in range(0, n, 2):
			a.append(arr[i])
		a = sorted(a)
		b = []
		for i in range(1, n, 2):
			b.append(arr[i])
		b = sorted(b, reverse=True)
		arr1 = a + b
		for i in range(len(arr1)):
			arr[i] = arr1[i]
		return arr


class Solution:

	def bitonicGenerator(self, arr, n):
		odd = []
		even = []
		for i in range(n):
			if i % 2 == 0:
				even.append(arr[i])
			else:
				odd.append(arr[i])
		odd = sorted(odd, reverse=True)
		even = sorted(even)
		k = even + odd
		for i in range(len(k)):
			arr[i] = k[i]
		return arr


class Solution:

	def bitonicGenerator(self, arr, n):
		even = []
		odd = []
		for i in range(n):
			if i % 2 != 0:
				odd.append(arr[i])
			else:
				even.append(arr[i])
		odd.sort(reverse=True)
		even.sort()
		even.extend(odd)
		arr[:] = even[:]


class Solution:

	def bitonicGenerator(self, arr, n):
		evenArr = []
		oddArr = []
		for i in range(n):
			if i % 2 == 0:
				evenArr.append(arr[i])
			else:
				oddArr.append(arr[i])
		evenArr = sorted(evenArr)
		oddArr = sorted(oddArr)
		oddArr = oddArr[::-1]
		i = 0
		for j in range(len(evenArr)):
			arr[i] = evenArr[j]
			i += 1
		for j in range(len(oddArr)):
			arr[i] = oddArr[j]
			i += 1


class Solution:

	def bitonicGenerator(self, arr, n):
		i = j = 0
		while j < n:
			(arr[i], arr[j]) = (arr[j], arr[i])
			i += 1
			j += 2
		arr[:(n + 1) // 2] = sorted(arr[:(n + 1) // 2])
		arr[(n + 1) // 2:] = sorted(arr[(n + 1) // 2:], reverse=True)


class Solution:

	def bitonicGenerator(self, arr, n):
		e = []
		o = []
		for i in range(n):
			if i == 0 or i % 2 == 0:
				e.append(arr[i])
			else:
				o.append(arr[i])
		e.sort()
		o.sort()
		b = e + list(reversed(o))
		for i in range(n):
			arr[i] = b[i]
		return arr


class Solution:

	def bitonicGenerator(self, arr, n):
		even = arr[::2]
		odd = arr[1::2]
		arr.clear()
		arr.extend(sorted(even) + sorted(odd, reverse=True))


class Solution:

	def bitonicGenerator(self, arr, n):
		eve = []
		odd = []
		c = []
		for i in range(n):
			if i % 2 == 0:
				eve += [arr[i]]
			else:
				odd += [arr[i]]
		eve.sort()
		odd.sort()
		odd = odd[::-1]
		c = eve + odd
		for i in range(n):
			arr[i] = c[i]
		return arr


class Solution:

	def bitonicGenerator(self, arr, n):
		e = [arr[i] for i in range(n) if i % 2 == 0]
		o = [arr[i] for i in range(n) if i % 2 != 0]
		k = sorted(e) + sorted(o)[::-1]
		arr[:] = k[:]
		return arr


class Solution:

	def bitonicGenerator(self, arr, n):
		even = []
		odd = []
		for i in range(n):
			if i % 2 == 0:
				even.append(arr[i])
			else:
				odd.append(arr[i])
		even.sort()
		odd.sort(reverse=True)
		res = even + odd
		for i in range(len(res)):
			arr[i] = res[i]
			i += 1
		return arr


class Solution:

	def bitonicGenerator(self, arr, n):
		c = []
		d = []
		for i in range(len(arr)):
			if i % 2 == 0:
				c.append(arr[i])
			else:
				d.append(arr[i])
		c.sort()
		d.sort(reverse=True)
		res = c + d
		for i in range(len(arr)):
			arr[i] = res[i]


class Solution:

	def bitonicGenerator(self, arr, n):
		ea = []
		oa = []
		for i in range(n):
			if i % 2 == 0:
				ea.append(arr[i])
			else:
				oa.append(arr[i])
		ea.sort()
		oa.sort(reverse=True)
		i = 0
		for j in range(len(ea)):
			arr[i] = ea[j]
			i += 1
		for j in range(len(oa)):
			arr[i] = oa[j]
			i += 1


class Solution:

	def bitonicGenerator(self, arr, n):
		even = []
		odd = []
		for i in range(n):
			if i % 2 == 0:
				even.append(arr[i])
			else:
				odd.append(arr[i])
		even = sorted(even)
		odd = sorted(odd)
		odd = odd[::-1]
		i = 0
		for j in range(len(even)):
			arr[i] = even[j]
			i += 1
		for j in range(len(odd)):
			arr[i] = odd[j]
			i += 1


class Solution:

	def bitonicGenerator(self, arr, n):
		e = []
		o = []
		for i in range(n):
			if i % 2 == 0:
				e.append(arr[i])
			else:
				o.append(arr[i])
		e.sort()
		o.sort(reverse=True)
		E = 0
		O = 0
		i = 0
		while E < len(e):
			arr[i] = e[E]
			i += 1
			E += 1
		while O < len(o):
			arr[i] = o[O]
			i += 1
			O += 1


class Solution:

	def bitonicGenerator(self, arr, n):
		evenarr = []
		oddarr = []
		for i in range(len(arr)):
			if i % 2 == 0:
				evenarr.append(arr[i])
			else:
				oddarr.append(arr[i])
		evenarr.sort()
		oddarr.sort(reverse=True)
		i = 0
		for j in range(len(evenarr)):
			arr[i] = evenarr[j]
			i += 1
		for j in range(len(oddarr)):
			arr[i] = oddarr[j]
			i += 1
		return arr


class Solution:

	def bitonicGenerator(self, arr, n):
		rese = []
		reso = []
		result = []
		for i in range(0, n):
			if i % 2 == 0:
				rese.append(arr[i])
			else:
				reso.append(arr[i])
		rese.sort()
		reso.sort(reverse=True)
		c = 0
		for i in range(len(rese)):
			arr[c] = rese[i]
			c += 1
		for j in range(0, len(reso)):
			arr[c] = reso[j]
			c += 1
		return arr


class Solution:

	def bitonicGenerator(self, arr, n):
		res1 = []
		res2 = []
		for i in range(n):
			if i % 2 == 0:
				res1.append(arr[i])
			else:
				res2.append(arr[i])
		res1.sort()
		res2.sort(reverse=True)
		for i in range(n):
			if i < len(res1):
				arr[i] = res1[i]
			else:
				arr[i] = res2[i - len(res1)]


class Solution:

	def bitonicGenerator(self, arr, n):
		even = []
		odd = []
		if n % 2:
			even.append(arr.pop())
		while arr:
			even.append(arr.pop(0))
			odd.append(arr.pop(0))
		arr += sorted(even) + sorted(odd, reverse=True)


class Solution:

	def bitonicGenerator(self, arr, n):
		l1 = []
		l2 = []
		for i in range(n):
			if i % 2 == 0:
				l1.append(arr[i])
			else:
				l2.append(arr[i])
		l1.sort()
		l2.sort(reverse=True)
		i = 0
		for j in range(len(l1)):
			arr[i] = l1[j]
			i += 1
		for j in range(len(l2)):
			arr[i] = l2[j]
			i += 1


class Solution:

	def bitonicGenerator(self, arr, n):
		even = []
		odd = []
		for i in range(0, n, 2):
			even.append(arr[i])
		for j in range(1, n, 2):
			odd.append(arr[j])
		even.sort()
		odd.sort(reverse=True)
		new_array = even + odd
		arr[:] = new_array[:]


class Solution:

	def bitonicGenerator(self, arr, n):
		lis = []
		ki = []
		for i in range(n):
			if i % 2 == 0:
				lis.append(arr[i])
			else:
				ki.append(arr[i])
		lis.sort()
		ki.sort()
		j = 0
		m = n - 1
		for i in lis:
			arr[j] = i
			j += 1
		for i in ki:
			arr[m] = i
			m -= 1
		return arr


class Solution:

	def bitonicGenerator(self, arr, n):
		(res, res1) = ([], [])
		for i in range(n):
			if i % 2 == 0:
				res.append(a[i])
			else:
				res1.append(a[i])
		res.sort()
		res1.sort(reverse=True)
		arr[:] = res[:] + res1[:]


class Solution:

	def bitonicGenerator(self, arr, n):
		odd = []
		even = []
		for i in range(0, n, 2):
			odd.append(arr[i])
		odd.sort()
		for i in range(1, n, 2):
			even.append(arr[i])
		even.sort(reverse=True)
		l_o = len(odd)
		arr[:l_o + 1] = odd[:]
		arr[l_o:] = even[:]
		return arr


class Solution:

	def bitonicGenerator(self, arr, n):
		even = []
		odd = []
		for i in range(0, len(arr)):
			if i % 2 == 0:
				even.append(arr[i])
			else:
				odd.append(arr[i])
		even.sort()
		odd.sort()
		m = odd[::-1]
		m1 = even + m
		for i in range(n):
			arr[i] = m1[i]
		return arr[i]


class Solution:

	def bitonicGenerator(self, arr, n):
		count = []
		temp = []
		for i in range(len(arr)):
			if i % 2 == 0:
				count.append(arr[i])
			else:
				temp.append(arr[i])
		count.sort()
		temp.sort(reverse=True)
		res = count + temp
		for i in range(len(arr)):
			arr[i] = res[i]


class Solution:

	def bitonicGenerator(self, arr, n):
		even = []
		odd = []
		for i in range(n):
			if i % 2 == 0:
				even.append(arr[i])
			else:
				odd.append(arr[i])
		even.sort()
		odd.sort()
		i = 0
		for k in even:
			arr[i] = k
			i += 1
		for j in range(len(odd) - 1, -1, -1):
			arr[i] = odd[j]
			i += 1
		return arr


class Solution:

	def bitonicGenerator(self, arr, n):
		l1 = []
		l2 = []
		temp = []
		for i in range(n):
			if i % 2 == 0:
				l1.append(arr[i])
			else:
				l2.append(arr[i])
		l1.sort()
		l2.sort(reverse=True)
		temp = l1 + l2
		for i in range(n):
			arr[i] = temp[i]


class Solution:

	def bitonicGenerator(self, arr, n):
		odd = []
		eve = []
		for i in range(1, n + 1):
			if i % 2 == 0:
				odd.append(arr[i - 1])
			else:
				eve.append(arr[i - 1])
		odd.sort(reverse=True)
		eve.sort()
		eve.extend(odd)
		for i in range(len(eve)):
			arr[i] = eve[i]


class Solution:

	def bitonicGenerator(self, arr, n):
		i = 0
		b = []
		while i < n:
			b.append(arr[i])
			i += 2
		i = 1
		c = []
		while i < n:
			c.append(arr[i])
			i += 2
		b.sort()
		c.sort()
		b.extend(c[::-1])
		for i in range(n):
			arr[i] = b[i]


class Solution:

	def bitonicGenerator(self, arr, n):
		ev = []
		od = []
		for i in range(0, len(arr)):
			if i % 2 == 0:
				ev.append(arr[i])
			else:
				od.append(arr[i])
		i = 0
		arr.clear()
		ev.sort()
		od.sort()
		j = len(od) - 1
		while i < len(ev) or j >= 0:
			if i == len(ev):
				arr.append(od[j])
				j -= 1
			else:
				arr.append(ev[i])
				i += 1
		return arr


class Solution:

	def bitonicGenerator(self, arr, n):
		a = []
		b = []
		for i in range(n):
			if i % 2 == 0:
				a.append(arr[i])
			else:
				b.append(arr[i])
		c = sorted(a)
		b.sort()
		b = b[::-1]
		c = c + b
		for i in range(n):
			arr[i] = c[i]


class Solution:

	def bitonicGenerator(self, arr, n):
		even = []
		odd = []
		for i in range(0, len(arr)):
			if i % 2 == 0:
				even.append(arr[i])
			else:
				odd.append(arr[i])
		even = sorted(even)
		odd = sorted(odd, reverse=True)
		for i in range(0, len(even)):
			arr[i] = even[i]
		count = 0
		for i in range(len(even), len(arr)):
			arr[i] = odd[count]
			count += 1


class Solution:

	def bitonicGenerator(self, arr, n):
		l = []
		m = []
		for i in range(len(arr)):
			if i % 2 == 0:
				l.append(arr[i])
			else:
				m.append(arr[i])
		l.sort()
		m.sort()
		m = m[::-1]
		j = 0
		for i in range(len(l)):
			arr[i] = l[i]
			j = j + 1
		for i in range(len(m)):
			arr[j] = m[i]
			j = j + 1


class Solution:

	def bitonicGenerator(self, arr, n):
		arr1 = []
		arr2 = []
		for i in range(0, len(arr)):
			if i % 2 == 0:
				arr1.append(arr[i])
			else:
				arr2.append(arr[i])
		arr1.sort()
		arr2.sort(reverse=True)
		counter = 0
		for i in range(0, len(arr1)):
			arr[i] = arr1[counter]
			counter += 1
		counter = len(arr1)
		count = 0
		for i in range(counter, len(arr)):
			arr[i] = arr2[count]
			count += 1
		return arr


class Solution:

	def bitonicGenerator(self, arr, n):
		arr1 = []
		arr2 = []
		for i in range(0, len(arr)):
			if i % 2 == 0:
				arr1.append(arr[i])
			else:
				arr2.append(arr[i])
		arr1.sort()
		arr2.sort(reverse=True)
		arr3 = arr1 + arr2
		for i in range(n):
			arr[i] = arr3[i]


class Solution:

	def bitonicGenerator(self, arr, n):
		e = []
		o = []
		for i in range(n):
			if i % 2 == 0:
				e.append(arr[i])
			else:
				o.append(arr[i])
		e.sort()
		o.sort(reverse=True)
		x = e + o
		for i in range(n):
			arr[i] = x[i]


class Solution:

	def bitonicGenerator(self, arr, n):
		ee = []
		oe = []
		ans = []
		for i in range(n):
			if i % 2 == 0:
				ee.append(arr[i])
			else:
				oe.append(arr[i])
		ee.sort()
		oe.sort(reverse=True)
		for i in oe:
			ee.append(i)
		for i in range(n):
			arr[i] = ee[i]
		return arr


class Solution:

	def bitonicGenerator(self, arr, n):
		even = []
		odd = []
		for i in range(0, n):
			if i % 2 == 0:
				even.append(arr[i])
			else:
				odd.append(arr[i])
		even.sort()
		odd.sort()
		odd = odd[::-1]
		even.extend(odd)
		arr.clear()
		arr.extend(even)


class Solution:

	def bitonicGenerator(self, arr, n):
		a = []
		b = []
		i = 0
		while i < n:
			if i % 2 == 0:
				a.append(arr[i])
			else:
				b.append(arr[i])
			i += 1
		a.sort()
		b.sort(reverse=True)
		arr[:] = a + b
if __name__ == '__main__':
	t = int(input())
	for _ in range(0, t):
		n = int(input())
		a = list(map(int, input().split()))
		ob = Solution()
		ob.bitonicGenerator(a, n)
		print(*a)


class Solution:

	def bitonicGenerator(self, arr, n):
		evenArr = []
		oddArr = []
		for i in range(n):
			if i % 2 == 0:
				evenArr.append(arr[i])
			else:
				oddArr.append(arr[i])
		evenArr = sorted(evenArr)
		oddArr = sorted(oddArr)
		oddArr = oddArr[::-1]
		i = 0
		for j in range(len(evenArr)):
			arr[i] = evenArr[j]
			i += 1
		for j in range(len(oddArr)):
			arr[i] = oddArr[j]
			i += 1
		return arr
if __name__ == '__main__':
	t = int(input())
	for _ in range(0, t):
		n = int(input())
		a = list(map(int, input().split()))
		ob = Solution()
		ob.bitonicGenerator(a, n)
		print(*a)


class Solution:

	def bitonicGenerator(self, arr, n):
		ev = []
		od = []
		ans = []
		for i in range(0, n, 2):
			ev.append(arr[i])
		for i in range(1, n, 2):
			od.append(arr[i])
		ev.sort()
		od.sort()
		for i in range(0, len(ev)):
			ans.append(ev[i])
		j = len(od) - 1
		while j >= 0:
			ans.append(od[j])
			j -= 1
		for i in range(0, len(ans)):
			arr[i] = ans[i]
if __name__ == '__main__':
	t = int(input())
	for _ in range(0, t):
		n = int(input())
		a = list(map(int, input().split()))
		ob = Solution()
		ob.bitonicGenerator(a, n)
		print(*a)


class Solution:

	def bitonicGenerator(self, arr, n):
		a = arr[0::2]
		b = arr[1::2]
		b.sort()
		b = b[::-1]
		a.sort()
		a.extend(b)
		for i in range(n):
			arr[i] = a[i]
if __name__ == '__main__':
	t = int(input())
	for _ in range(0, t):
		n = int(input())
		a = list(map(int, input().split()))
		ob = Solution()
		ob.bitonicGenerator(a, n)
		print(*a)


class Solution:

	def bitonicGenerator(self, arr, n):
		l1 = []
		l2 = []
		for i in range(len(arr)):
			if i % 2 == 0:
				l1.append(arr[i])
			else:
				l2.append(arr[i])
		l1 = sorted(l1)
		l2 = sorted(l2, reverse=True)
		i = 0
		for j in range(len(l1)):
			arr[i] = l1[j]
			i += 1
		for j in range(len(l2)):
			arr[i] = l2[j]
			i += 1
if __name__ == '__main__':
	t = int(input())
	for _ in range(0, t):
		n = int(input())
		a = list(map(int, input().split()))
		ob = Solution()
		ob.bitonicGenerator(a, n)
		print(*a)


class Solution:

	def bitonicGenerator(self, arr, n):
		a = arr
		b = []
		c = []
		d = []
		for i in range(n):
			if i % 2 == 0:
				b += [a[i]]
			else:
				c += [a[i]]
		b.sort()
		c.sort(reverse=True)
		d = b + c
		for i in range(len(b)):
			arr[i] = b[i]
		for i in range(len(c)):
			arr[len(b) + i] = c[i]
		return arr
if __name__ == '__main__':
	t = int(input())
	for _ in range(0, t):
		n = int(input())
		a = list(map(int, input().split()))
		ob = Solution()
		ob.bitonicGenerator(a, n)
		print(*a)


class Solution:

	def bitonicGenerator(self, a, n):
		(e, o) = ([], [])
		for i in range(n):
			if i & 1:
				o.append(a[i])
			else:
				e.append(a[i])
		e.sort()
		o.sort(reverse=True)
		a[:] = e + o


class Solution:

	def bitonicGenerator(self, arr, n):
		list1 = []
		list2 = []
		for i in range(len(arr)):
			if i % 2 == 0:
				list1.append(arr[i])
			else:
				list2.append(arr[i])
		list1.sort()
		list2.sort()
		arr.clear()
		arr = list1 + list2[::-1]
		for i in arr:
			print(i, end=' ')


class Solution:

	def bitonicGenerator(self, arr, n):
		ev = []
		odd = []
		for i in range(len(arr)):
			if i % 2 == 0:
				ev.append(arr[i])
			else:
				odd.append(arr[i])
		ev.sort()
		odd.sort(reverse=True)
		res = ev + odd
		for i in range(len(arr)):
			arr[i] = res[i]


class Solution:

	def bitonicGenerator(self, arr, n):
		e = []
		o = []
		for i in range(0, n):
			if i % 2 == 0:
				e.append(arr[i])
			else:
				o.append(arr[i])
		e = sorted(e) + sorted(o, reverse=True)
		arr.clear()
		for i in range(n):
			arr.append(e[i])


class Solution:

	def bitonicGenerator(self, arr, n):
		even_arr = []
		odd_arr = []
		for i in range(len(arr)):
			if i % 2 == 0:
				even_arr.append(arr[i])
			else:
				odd_arr.append(arr[i])
		even_arr.sort()
		odd_arr = sorted(odd_arr, reverse=True)
		i = 0
		for j in range(len(even_arr)):
			arr[i] = even_arr[j]
			i += 1
		for j in range(len(odd_arr)):
			arr[i] = odd_arr[j]
			i += 1


class Solution:

	def bitonicGenerator(self, arr, n):
		(even, odd) = ([], [])
		for ind in range(n):
			if ind % 2 == 0:
				even.append(arr[ind])
			else:
				odd.append(arr[ind])
		ind = 0
		for ele in sorted(even):
			arr[ind] = ele
			ind += 1
		for ele in sorted(odd, reverse=True):
			arr[ind] = ele
			ind += 1


class Solution:

	def bitonicGenerator(self, arr, n):
		s1 = []
		s2 = []
		for i in range(n):
			if i % 2 == 0:
				s1.append(arr[i])
			else:
				s2.append(arr[i])
		s1 = sorted(s1)
		s2 = sorted(s2)
		s2 = s2[::-1]
		i = 0
		for j in range(len(s1)):
			arr[i] = s1[j]
			i += 1
		for j in range(len(s2)):
			arr[i] = s2[j]
			i += 1
		return arr


class Solution:

	def bitonicGenerator(self, arr, n):
		as1 = []
		ds = []
		for i in range(len(arr)):
			if i % 2 == 0:
				as1.append(arr[i])
			if i % 2 != 0:
				ds.append(arr[i])
		as1 = sorted(as1)
		ds = sorted(ds, reverse=True)
		for i in range(len(as1)):
			a[i] = as1[i]
		for i in range(len(ds)):
			a[i + len(as1)] = ds[i]
		return a


class Solution:

	def bitonicGenerator(self, arr, n):
		(e, o) = ([], [])
		for i in range(n):
			if i % 2 == 0:
				e.append(arr[i])
			else:
				o.append(arr[i])
		(e.sort(), o.sort())
		e.extend(o[::-1])
		for i in range(n):
			arr[i] = e[i]


class Solution:

	def bitonicGenerator(self, a, n):
		e = []
		o = []
		for i in range(len(a)):
			if i % 2 == 0:
				e.append(a[i])
			else:
				o.append(a[i])
		e.sort()
		o.sort(reverse=True)
		a.clear()
		for i in e:
			a.append(i)
		for i in o:
			a.append(i)
		return a


class Solution:

	def bitonicGenerator(self, arr, n):
		num1 = []
		num2 = []
		for i in range(n):
			if i % 2 == 0:
				num1.append(arr[i])
			else:
				num2.append(arr[i])
		num1.sort()
		num2.sort()
		num2 = num2[::-1]
		i = 0
		c = num1 + num2
		arr[:] = c[:]


class Solution:

	def bitonicGenerator(self, arr, n):
		kev = []
		kod = []
		for i in range(len(arr)):
			if i % 2 == 0:
				kev.append(arr[i])
			else:
				kod.append(arr[i])
		kev.sort()
		kod.sort()
		kod = kod[::-1]
		res = kev + kod
		for i in range(len(res)):
			arr[i] = res[i]


class Solution:

	def bitonicGenerator(self, arr, n):
		(evens, odds) = ([], [])
		for i in range(n):
			if i % 2 == 0:
				evens.append(arr[i])
			elif i % 2 == 1:
				odds.append(arr[i])
		evens.sort()
		odds.sort(reverse=True)
		res = []
		res = evens + odds
		for i in range(len(res)):
			arr[i] = res[i]