i want a simple c code to delete duplicate elements in an array
C program to delete duplicate elements in an array?
http://www.google.com/codesearch?q=array...
Reply:assuming your array is x with n elements.
i=0;
while (i%26lt;n-1)
{
j=i+1;
while(j%26lt;n)
{
if (x[i]==x[j])
{
for (int k=j; k%26lt;n-1; k++)
x[k]=x[k+1];
n--
}
j++;
}
i++;
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment