删除节点(链表)
删除最后一个节点: person *current1 , *current2 ;
current1 = head ;
current2 = current -> next ;
while ( current2 -> next != NULL )
{
current1 = current2 ;
current2 = current1 -> next ;
}
free ( current1 -> next ) ;
current1 -> next = null ;
if ( head == current1 )
head = null ;
哪位学友解释一下这些代码?今天刚弄懂了插入节点,现在删除节点又迷糊了。。。