This Challenge is derived from GJam 2014 China Sorting.
This Challenge is to take a vector of Odd/Even values; Sort Odd Values Increasing and place into original Odd locations; Sort Even Values Decreasing and place into original Even locations.
Input: V a vector
Output: Vout a sorted vector Odds Increasing/Evens Increasing
Example:
V= [-5 -12 87 2 88 20 11]
Vout=[-5 88 11 20 2 -12 87]
Contest Performance: Best Time to Complete: < 10 minutes
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers28
Suggested Problems
-
3496 Solvers
-
Sum all integers from 1 to 2^n
18164 Solvers
-
Numbers with prime factors 2, 3 and 5.
683 Solvers
-
middleAsColumn: Return all but first and last element as a column vector
654 Solvers
-
Replace multiples of 5 with NaN
472 Solvers
More from this Author306
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!