(int arr[], int key, int i)
| 59 | } |
| 60 | |
| 61 | public static int firstOccurence(int arr[], int key, int i) { |
| 62 | if(i == arr.length) { |
| 63 | return -1; |
| 64 | } |
| 65 | if(arr[i] == key) { |
| 66 | return i; |
| 67 | } |
| 68 | |
| 69 | return firstOccurence(arr, key, i+1); |
| 70 | } |
| 71 | |
| 72 | public static int lastOccurence(int arr[], int key, int i) { |
| 73 | if(i == arr.length) { |
nothing calls this directly
no outgoing calls
no test coverage detected