(int visitedArray[],int element)
| 25 | { |
| 26 | //Function to check if we have already seen an element or not. |
| 27 | public boolean notInVisited(int visitedArray[],int element) |
| 28 | { |
| 29 | // Iterate the visitedArray |
| 30 | for(int i=0;i<visitedArray.length;i++) |
| 31 | { |
| 32 | if(visitedArray[i] == element) |
| 33 | return false; |
| 34 | } |
| 35 | return true; |
| 36 | } |
| 37 | |
| 38 | public int countOccurence(int[] arr, int n, int k) |
| 39 | { |