Wednesday, May 21, 2008

What are we aiming to accomplish with this code?

int remove_duplicates(int * p, int size)
{
int current, insert = 1;
for (current=1; current < size; current++)
if (p[current] != p[insert-1])
{
p[insert] = p[current];
current++; insert++;
}
else current++;
return insert;
}

No comments: