Question: Q8. (16points) Given an array A of n numbers, write an algorithm to sort all the odd numbers in non-decreasing order at the beginning of
Q8. (16points) Given an array A of n numbers, write an algorithm to sort all the odd numbers in non-decreasing order at the beginning of the array followed by all the sorted even numbers in non-increasing order. For example, Before sorting: 5, 3, 10, 12, 2, 34, 55, 65, 4, 7, 5 After sorting: 3,5, 5, 7, 55, 65, 34, 12, 10, 4, 2 What's the complexity of your algorithm
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
