Advanced Java Programming20775 marksNumerical: array all possibilities methodArrays
A non-empty array A of length n is called an array of all possibilities if it contains all numbers between 0 and A.length-1 inclusive. Write a method named isAllPossibilities that accepts an integer array and returns 1 if the array is an array of all possibilities, otherwise it returns 0.
A non-empty array A of length n is called an array of all possibilities if it contains all numbers between 0 and A.length-1 inclusive. Write a method named isAllPossibilities that accepts an integer array and returns 1 if the array is an array of all possibilities, otherwise it returns 0. [5]
- Input: a non-empty integer array A of length n. - Condition: A must contain all integers from 0 to n-1 inclusive. - Output: return 1 if the condition holds, otherwise 0. (No specific test arrays are mandated by the question; behaviour must be general.) An array of length n qualifies if and only...