文章已搬家,請點擊前往👈 REDIRECT_MODE = 1; 簡介 連結串列(Linked List)是串列(List)的一種,是一種常見的資料結構,利用這個資料結構也能進一步實作出其他的資料結構,例如堆疊(Stack)和佇列(Queue)等。
void insert_after(Node* node, T value)//加入新節點到此節點的後面
{
Node* newNode = new Node(value);
newNode->next = node->next;
node->next = newNode;
if(node==LinkedList::last){LinkedList::last=newNode;}
++LinkedList::count;
}
by 常常懶得做作業來這裡抄的同學
已修正
請問要怎麼在main.cpp內 加入insert_before (c++ doublelinked list版本)
假設你檔案為DoublyLinkedList.h, 在main.cpp #include "DoublyLinkedList.h"