sort array by even or odd elements