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

Method isSorted

7_RecursionBasics/RecursionBasics.java:49–59  ·  view source on GitHub ↗
(int arr[], int i)

Source from the content-addressed store, hash-verified

47 }
48
49 public static boolean isSorted(int arr[], int i) {
50 if(i == arr.length-1) {
51 return true;
52 }
53
54 if(arr[i] > arr[i+1]) {
55 return false;
56 }
57
58 return isSorted(arr, i+1);
59 }
60
61 public static int firstOccurence(int arr[], int key, int i) {
62 if(i == arr.length) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected