Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions