S
spl
What is the fastest way to find a duplicate value in an array of 10
elements. I have to find just any one first occurrence of the
duplication.
Lets say I have ary[10]={10, 20, 40, 90, 30, 60, 35, 40, 85, 90}. Here
if I have to 40 is duplicated, that's fine, I don't required to find
90 is also repeating. I don't want to use STLs.
Can suggest any fast algorithm for this?
elements. I have to find just any one first occurrence of the
duplication.
Lets say I have ary[10]={10, 20, 40, 90, 30, 60, 35, 40, 85, 90}. Here
if I have to 40 is duplicated, that's fine, I don't required to find
90 is also repeating. I don't want to use STLs.
Can suggest any fast algorithm for this?