| 1 | package Programs; |
| 2 | |
| 3 | public class Check_If_Sorted { |
| 4 | public static void main(String[] args) { |
| 5 | int[] toCheck = {1, 2, 3, 5, 16, 8}; |
| 6 | int pointer = 0; |
| 7 | System.out.println(checkIfSorted(toCheck, pointer)); |
| 8 | } |
| 9 | |
| 10 | private static boolean checkIfSorted(int[] toCheck, int pointer) { |
| 11 | if (pointer == toCheck.length - 1) { |
| 12 | return true; |
| 13 | } |
| 14 | return toCheck[pointer] < toCheck[pointer + 1] && checkIfSorted(toCheck, pointer + 1); |
| 15 | } |
| 16 | } |
nothing calls this directly
no outgoing calls
no test coverage detected