Question: An INT array of n integers is given. For the following questions, design an algorithm that runs at O (n) processing time without using any
An INT array of n integers is given. For the following questions, design an algorithm that runs at O (n) processing time without using any other array except the INT array, and write the pseudo-codes of the algorithms. (Your algorithms that do not meet the restrictions will be evaluated over 5 points.) a) (15 points) There is no 0 among the elements of the INT array. Reposition the elements of this array so that all negative numbers precede all positive numbers. b) (15 points) Reposition the elements of the INT array to negative numbers first, then zeros, then positive numbers.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
