Last active
October 21, 2017 22:23
-
-
Save MukulLatiyan/d21d66ce894ac7e2c3ed0adf7ad19c57 to your computer and use it in GitHub Desktop.
Binary Array Sorting(GeeksForGeeks)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Java code for Binary Array Sorting problem on geeksforgeeks(School problem-array Section). | |
import java.util.*; | |
import java.lang.*; | |
import java.io.*; | |
class GFG | |
{ | |
public static void main (String[] args) | |
{ | |
Scanner sc=new Scanner(System.in); | |
int t=sc.nextInt(); | |
while(t-->0) | |
{ | |
int n=sc.nextInt(); | |
int a[]=new int[n]; | |
for(int i=0;i<n;i++) | |
{ | |
a[i]=sc.nextInt(); | |
} | |
Arrays.sort(a); | |
for(int i=0;i<n;i++) | |
{ | |
System.out.print(a[i]+" "); | |
} | |
System.out.println(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment