I have an unsorted array, what is the best method to remove all the duplicates of an element if present?
e.g:
a[1,5,2,6,8,9,1,1,10,3,2,4,1,3,11,3] >
indexOutput = 1; outputArray[0] = arrayInt[0]; int j; for (int i = 1; i < arrayInt.length; i++) { j = 0; while ((outputArray[j] != arrayInt[i]) && j < indexOutput) { j++; } if(j == indexOutput){ outputArray[indexOutput] = arrayInt[i]; indexOutput++; } }