2 回答

完美丶沉睡
TA貢獻1條經驗 獲得超0個贊
bool?PriorElem(Node?*pCurrentNode,Node?*pPreNode)
{ Node?*currentNode?=?m_pList;
?Node?*tempNode?=?NULL;
?while(currentNode->next!=NULL)
????{
????????currentNode=currentNode->next;
?????????if?(currentNode->data?==?pCurrentNode->data)
????????????{
?????????????????if?(tempNode?==?m_pList)
?????????????????????{
?????????????????????????return?false;
?????????????????????}
?????????????????pPreNode->data=tempNode->data;
?????????????????return?true;
?????????????}
????}
?return?false;
}
這是 ?數據結構 鏈表 里找前驅的函數....這里的 *currentNode 不需要銷毀么?
- 2 回答
- 0 關注
- 1333 瀏覽
添加回答
舉報
0/150
提交
取消