+ 8

How are duplicates removed from an array without using any library?

Duplicates in java

20th Feb 2019, 7:32 PM
Anwesha patel
Anwesha patel - avatar
3 odpowiedzi
+ 5
Int a[]={3,5,8,8}; For(int I=0;I<a.lenght;I++) { For(int j=a.lenght;j>i;j--) { If(a[I].equals(a[j])) { flag=1 } else{ K++; a[K]=a[I]; } } if(flag!=1) { System.out.print(a[k]); } } that is perfect
21st Feb 2019, 2:22 AM
Gaurav Pratap singh
Gaurav Pratap singh - avatar
+ 3
You can use temporary array
27th Apr 2020, 9:15 PM
NITESH KUMAR
NITESH KUMAR - avatar