数据结构——双链表(C++)
1. C封装成类,基于面向对象class DoublyLinkedList {
private:struct Node {int data;Node* prior;Node* next;Node(int d) : data(d), prior(nullptr), next(nullptr) {}};Node* head; // 哨兵头节点Node* last;public:DoublyLinkedList() : head(new Node(0)), l…
2026/6/27 14:43:00