Question: There are some integers in an array of even size. Write a C program to rearrange the array such that left-half is in increasing order

 There are some integers in an array of even size. Write

a C program to rearrange the array such that left-half is in

increasing order and right-half is in decreasing order. Print the distances (positive

There are some integers in an array of even size. Write a C program to rearrange the array such that left-half is in increasing order and right-half is in decreasing order. Print the distances (positive difference) between the corresponding elements from minimum to maximum of the left-half and right-half. Note: The array must be represented through a pointer. One function rearrange() must be defined for the necessary rearrangement. Input Format The inputs to the program are: (i) a positive integer indicating the no. of elements, (ii) a set of positive integers indicating the array elements (separated by a space) Constraints 0 Output Format The outputs of the program are positive integers indicating the distances between the corresponding elements Sample Input 0 6 9 5 6 3 12 7 Sample Output 0 2 1 3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!