Question
Sort the first and second half of an array Anjali likes to play mathematical tricky games .She gets n numbers for an array. Help Anjali
Sort the first and second half of an array
Anjali likes to play mathematical tricky games .She gets n numbers for an array. Help Anjali to write a Java program to sort the first half of the array in ascending order and the second half of the array in descending order. If the size of the array is 0 or lesser then display the message as "Array size should be greater then 0".
Sample Input 1:
Enter the size of an array:
5
Enter the elements:
89
23
56
12
99
Sample Output 1:
23
56
89
99
12
Sample Input 2:
Enter the size of an array:
0
Sample Output 2:
Array size should be greater then 0
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started