How to arrange array in half Ascending and Half Descending order | Java

preview_player
Показать описание
Hello Everyone!!

I have created a program which is frequently asked in TCS Pre-selection aptitude round in Command line section.
To print the length in half ascending and half descending.
-------------------------------------------------------------------------
Input : 2,3,2,5,7,5,6,3
Output : 2,2,3,3,7,6,5,5
-------------------------------------------------------------------------
How to do that?
we have to use Swap function to sort array in ascending order.
By using formula:
Temp=a;
a=b;
b=Temp;
More detailed explaination is there in the video!!
-------------------------------------------------------------------------
Thank you!!!

Please support my channel by Liking my videos, Sharing it as well as Subscribing it!!
-------------------------------------------------------------------------
#instapickup
#javaprogram
#java
#programmingconcepts
Рекомендации по теме
Комментарии
Автор

Because of you i cracked one wipro question based on series. Thanx man

arhamansari
Автор

What if I input 5 numbers to sort, then it will sort only 4 numbers

prashanttrivedi