这点 code 里,有问题吗# JobHunting - 待字闺中
r*r
1 楼
To delete an element from an array:
public boolean delete(int value)
{
int j = find(value);
if(j==nElems) // can’t find it
return false;
else // found it
{
for(int k=j; k a[k] = a[k+1];
nElems--; // decrement size
return true;
}
} // end delete()
public boolean delete(int value)
{
int j = find(value);
if(j==nElems) // can’t find it
return false;
else // found it
{
for(int k=j; k
nElems--; // decrement size
return true;
}
} // end delete()