Algorithms & Data Structure
[Data Structure] 원형 이중 연결 리스트(Circular Doubly Linked List)
PSLeon
2023. 5. 30. 10:14
반응형
Add 부분 손 로직
- 전체 구조가 너무 복잡하므로 기본적으로 아래의 구조적 특징은 외우는 것이 편하리라 판단된다.
- head가 가리키는 dummy 노드의 prev는 항상 꼬리 노드(마지막 노드)를 가리킨다.
- head가 가리키는 dummy 노드의 next는 항상 더미노드를 제외한 머리 노드(시작 노드)를 가리킨다.
- 더미 노드가 아닌 머리 노드의 prev는 더미 노드를 가리키고, next는 다음 노드를 가리킨다.
- 꼬리 노드(마지막 노드)의 prev는 이전 노드를 가리키고 next는 더미 노드를 가리킨다.
파이썬 구현
https://github.com/PSLeon24/DataStructure-Algorithms/blob/main/Circular_Doubly_Linked_List.py
GitHub - PSLeon24/DataStructure-Algorithms: Do it! 자료구조와 함께 배우는 알고리즘 입문(Python)
Do it! 자료구조와 함께 배우는 알고리즘 입문(Python). Contribute to PSLeon24/DataStructure-Algorithms development by creating an account on GitHub.
github.com