#!/usr/bin/python3 # # Write a python function that takes an array of integers and sorts # that array in-place so that all the even numbers (if any) precede # all the odd numbers (if any). Briefly analyze the complexity of your # solution. # # Sorting in-place means permuting the content of the array without # using an additional array. More specifically, it means using a # constant amount of extra space. # def evenodd(A): ## ## Fill-in your solution here. ## A=[] while True: try: l = input() for n in l.split(): A.append(int(n)) except (EOFError): break except: print('bad value:', n) exit(1) evenodd(A) for a in A: print(a)