MCPcopy Create free account
hub / github.com/SR-Sunny-Raj/Hacktoberfest2021-DSA / bSort

Method bSort

06. Sorting/countSort.java:5–16  ·  view source on GitHub ↗
(int[] arr, int n)

Source from the content-addressed store, hash-verified

3public class code {
4
5 public static int[] bSort(int[] arr, int n) {
6 for (int i = 0; i < n; i++) {
7 for (int j = 0; j < n - 1 - i; j++) {
8 if (arr[j] > arr[j + 1]) {
9 int temp = arr[j];
10 arr[j] = arr[j + 1];
11 arr[j + 1] = temp;
12 }
13 }
14 }
15 return arr;
16 }
17
18 public static void main(String[] args) throws java.lang.Exception {
19 Scanner sc = new Scanner(System.in);

Callers 1

mainMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected