remove函数的编写
template<class List_entry>
Error_code List<List_entry>::remove(int position,List_entry &x)
{
if(position<0||position>count)
return range_error;
Node<List_entry>*previous,*following,*current;
else if(position>0){
previous=set_position(position-1);
current=set_position(position);
following=current->next;
previous->next=following;
}
else if(position==0)
{previous=set_position(0);
following=previous->next;
head=following;}
count--;
return success;}
                    
                
                
            
        
浙公网安备 33010602011771号