print
Advertisment
Advertisment

remove duplicate element in an Array

Example 2

class RemoveDuplicateInArrayExample{  
public static int removeDuplicateElements(int arr[], int n){  
        if (n==0 || n==1){  
            return n;  
        }  
        int[] temp = new int[n];  
        int j = 0;  
        for (int i=0; i

Output :

 
   
10 20 30 40 50 
   
Advertisment
Advertisment
arrow_upward