Possible Duplicate:
simple question regarding sorting
Design an algorithm with min time and space
here is my solution -
- assume a array of N elements with 32 bit integers
- use a bit array to set the appropriate bits
- the array is sorted now
- assign even numbers to the first half of the array in ascending order
- assign odd numbers to the second half of the array in descending order
any better solution ?