MCPcopy Create free account
hub / github.com/apna-college/Alpha / bubbleSortDescending

Method bubbleSortDescending

2_Basic Sorting/BubbleSort.java:37–48  ·  view source on GitHub ↗
(int arr[])

Source from the content-addressed store, hash-verified

35 }
36
37 public static void bubbleSortDescending(int arr[]) {
38 for(int turn=0; turn<arr.length-1; turn++) {
39 for(int j=0; j<arr.length-1-turn; j++) {
40 if(arr[j] < arr[j+1]) {
41 //swap
42 int temp = arr[j];
43 arr[j] = arr[j+1];
44 arr[j+1] = temp;
45 }
46 }
47 }
48 }
49
50 public static void printArr(int arr[]) {
51 for(int i=0; i<arr.length; i++) {

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected