simple question regarding sorting
Posted
by mousey
on Stack Overflow
See other posts from Stack Overflow
or by mousey
Published on 2010-05-23T02:41:38Z
Indexed on
2010/05/23
2:50 UTC
Read the original article
Hit count: 257
Given a array of random integers, sort the odd elements in descending order and even numbers in ascending order.
e.g. for input (1,4,5,2,3,6,7)
Output = (7,5,3,1,2,4,6)
Optimize for time complexity.
© Stack Overflow or respective owner