Doubly Linked List 02
Noded 삽입 삭제 코드 구현 #pragma once#include using namespace std;class Node{ //typedef int T; Old style using T = int;public : //constructor :int타입의 변수를 받아서 T data에 넣어주고 //prev & next는 nullptr로 초기화 Node(int data) : data(data), prev(nullptr), next(nullptr) { }public: T data; Node* prev; Node* next;};class List{public: List() { //더미 노드 두개를 앞뒤로 만들기 _head = new Node(0); _tail = new Node(0); _head->ne..
자료구조&알고리즘/C++
2024. 12. 11. 09:00