Skip to content

Instantly share code, notes, and snippets.

@MukulLatiyan
Last active October 21, 2017 22:23
Show Gist options
  • Save MukulLatiyan/d21d66ce894ac7e2c3ed0adf7ad19c57 to your computer and use it in GitHub Desktop.
Save MukulLatiyan/d21d66ce894ac7e2c3ed0adf7ad19c57 to your computer and use it in GitHub Desktop.
Binary Array Sorting(GeeksForGeeks)
//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