正在加载图片...
newListNode=GetListNode(nltem) ptrCurr->InsertAfter(newListNode); /将数据为 nItem的结点插入到链表的当前位置之前 template<class t void Linkedlist<t>:: InsertAt(const T& nItem) Listnode<t>i newlistnode f! otrPrev)/插入到头结点 newListNode=GetListNode(nItem, ptr Front); newListNode->SetNext(ptrFront); ptrFront-newListNode; nListLength++; else∥/一般情况 (续)newListNode=GetListNode(nItem); ptrCurr->InsertAfter(newListNode); } } //将数据为nItem的结点插入到链表的当前位置之前 template<class T> void LinkedList<T>::InsertAt(const T& nItem) { ListNode<T> *newListNode; if(!ptrPrev) //插入到头结点 { newListNode=GetListNode(nItem,ptrFront); newListNode->SetNext(ptrFront); ptrFront=newListNode; nListLength++; } else //一般情况 { (续)
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有