human
Sort even and odd placed elements in increasing order | function to prin the odd and even indexed digits.
lists to store the odd and even positioned digits.
traverse through all the indexes in the integer.
if the digit is in odd_index position append it to odd_position list.
else append it to the even_position list.
print the elements in the list in sorted order.
Driver Code"
Solution in Python:
assistant
#Here is code to sort even and odd placed elements in increasing order and the other steps required.
 def odd_even ( n ) :
	odd_indexes = [ ]
	even_indexes = [ ]
	for i in range ( len ( n ) ) :
		if i % 2 == 0 : odd_indexes . append ( n [ i ] )
		else : even_indexes . append ( n [ i ] )
	for i in sorted ( odd_indexes ) : print ( i , end = " ▁ " )
	for i in sorted ( even_indexes ) : print ( i , end = " ▁ " )
n = [ 3 , 2 , 7 , 6 , 8 ]
odd_even ( n )