You are viewing a single comment's thread. Return to all comments →
here your code consist of so many line the simpler way to do this problem
Scanner in = new Scanner(System.in); int N= in.nextInt(); int[] arr = new int[N]; int[] a = new int[N]; for(int i=0;i<N;i++){ arr[i]=in.nextInt(); a[arr[i]]++; } for(int j=0;j<100;j++){ for(int k=0;k<a[j];k++){ System.out.print(j +" "); } }
Seems like cookies are disabled on this browser, please enable them to open this website
Counting Sort 2
You are viewing a single comment's thread. Return to all comments →
here your code consist of so many line the simpler way to do this problem