/*在O(1)复杂度内删除指定节点*/
void deleteNode(LinkNode *& pHead, LinkNode * pDelNode)
{if(pHead &#61;&#61; NULL)cout<<"链表为空\n";if(pDelNode &#61;&#61; NULL)cout<<"所删除节点不存在\n";if (pDelNode !&#61; pHead && pDelNode->_next !&#61; NULL)///中间节点
{LinkNode * pTemp &#61; pDelNode->_next;pDelNode->_value &#61; pDelNode->_next->_value;pDelNode->_next &#61; pDelNode->_next->_next;delete pTemp;pTemp &#61; 0;}else if (pDelNode &#61;&#61; pHead)////被删除的是头结点
{pHead &#61; pDelNode->_next;delete pDelNode;}else if(pDelNode->_next &#61;&#61; NULL){LinkNode * pTemp &#61; pHead;while(pTemp->_next !&#61; pDelNode)pTemp &#61; pTemp->_next;pTemp->_next &#61; NULL;delete pDelNode;}
}