Notice
Recent Posts
Recent Comments
Link
250x250
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Tree/RBTree/Deletion
- reversing
- Tree/Traversal
- Tree/AVL/Deletion
- tree
- CS/자료구조/Singly_Linked_List
- 리버싱
- forensic
- 코드엔진
- Tree/AVL
- CS/자료구조/Queue
- CS/자료구조/Stack
- Tree/BST
- CS/자료구조/Doubly_Linked_List
- codeengn
- CS/자료구조/Circular_Queue
- UTCTF
- Tree/Binary_Search_Tree
- CS/자료구조/Priority_Queue
- Tree/RBTree
- CS/자료구조/Linked_List
- CS/자료구조/Circular_Linked_List
- Tree/AVL/Insertion
- Tree/RBTree/Insertion
- ctf
- Tree/Binary_Tree
Archives
- Today
- Total
SuperVingo
Singly Linked List 본문
728x90
Head : Linked List의 시작 노드를 가르키는 포인터
Node : 데이터를 가르키는 포인터(Data) + 다음 노드를 가르키는 포인터(Next)
마지막 Node의 Next : NULL
Search
node = *head;
while(!node) {
if(node->data == want)
return true;
node=node->next;
}
return false;
Insertion
Case 1. Insertion at The Front
- 새로운 Node 생성(New)
- New->Next = Head
- Head = New
Case 2. Insertion after The Node
- 새로운 Node 생성(New)
- New->Next = Curr->Next
- Curr->Next = New
Case 3. Insertion at The End
- 새로운 Node 생성(New)
- End->Next = New
Deletion
Case 1. Deletion at The Front
- Head = Front->Next
- Free The Node
Case 2. Deletion after The Node
- Prev->Next = Curr->Next
- Free The Node
Case 3. Deletion at The End
- Prev->Next = NULL
- Free The Node
728x90
'Computer Science[CS] > Data Structure[자료구조]' 카테고리의 다른 글
Self-balancinig BST 자가 균형 이진 탐색 트리 (0) | 2024.01.04 |
---|---|
Tree / BST (1) | 2024.01.03 |
Stack, Queue (1) | 2024.01.01 |
Doubly Linked List (0) | 2024.01.01 |
Circular Linked List (0) | 2024.01.01 |