Consider the following sorting problem: you must reorder the elements of an array of numbers in-place so that odd numbers are in odd positions while even numbers are in even positions. If there are...


Consider the following sorting problem: you must reorder the elements of an array of numbers
in-place so that odd numbers are in odd positions while even numbers are in even positions. If
there are more even elements than odd ones in A (or vice-versa) then those additional elements
will be grouped at the end of the array. For example, with an initial sequence
A = 50, 47, 92, 78, 76, 7, 60, 36, 59, 30, 50, 43
The result could be this:
A = 47, 50, 7, 92, 59, 78, 59, 76, 43, 92, 36, 60, 30, 50



Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here