IBM Interview Question

Sort an array in meandering order.