SlideShare a Scribd company logo
Professor Joongheon Kim
https://joongheon.github.io
C Programming
C Programming
Linked List (Examples)
Prof. Joongheon Kim
Korea University, School of Electrical Engineering
Artificial Intelligence and Mobility Laboratory
https://joongheon.github.io
joongheon@korea.ac.kr
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (Main Function)
2
ID value next
int int
Pointer
(NODE)
NODE
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (Main Function)
3
ID value next
int int
Pointer
(NODE)
NODE
NULL
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code Functions
• Linked List Sample Code
• ll_input()
• ll_print()
• ll_update()
• Ll_delete()
4
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_input() Function)
5
ID value next
int int
Pointer
(NODE)
NODE
NULL
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
HEAD == NULL
11
INT:
in_value
1
INT:
in_ID
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_input() Function)
6
ID value next
int int
Pointer
(NODE)
NODE
HEAD == NULL
NODE
0xf1
NULL
0xf1
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
11
INT:
in_value
1
INT:
in_ID
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_input() Function)
7
ID value next
int int
Pointer
(NODE)
NODE
HEAD == NULL
NODE
0xf1
0xf1
0xf1
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
11
INT:
in_value
1
INT:
in_ID
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_input() Function)
8
ID value next
int int
Pointer
(NODE)
NODE
HEAD == NULL
0xf1
0xf1
0xf1
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 NULL
11
INT:
in_value
1
INT:
in_ID
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_input() Function)
9
ID value next
int int
Pointer
(NODE)
NODE
HEAD == NULL
0xf1
0xf1
0xf1
0xf1
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 NULL
11
INT:
in_value
1
INT:
in_ID
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_input() Function)
10
ID value next
int int
Pointer
(NODE)
NODE
HEAD == NULL
0xf1
0xf1
0xf1
0xf1
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 NULL
(ID, Values): (1, 11)
/* We will study print() later */ 11
INT:
in_value
1
INT:
in_ID
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_input() Function)
11
ID value next
int int
Pointer
(NODE)
NODE
HEAD != NULL (1st iteration)
0xf1
0xf1
0xf1
0xf1
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 NULL
22
INT:
in_value
2
INT:
in_ID
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_input() Function)
12
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xf1
0xcf
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 NULL
0xcf
HEAD != NULL (1st iteration)
22
INT:
in_value
2
INT:
in_ID
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_input() Function)
13
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xf1
0xcf
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
HEAD != NULL (1st iteration)
22
INT:
in_value
2
INT:
in_ID
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_input() Function)
14
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xf1
0xcf
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
HEAD != NULL (1st iteration)
2 22 NULL
22
INT:
in_value
2
INT:
in_ID
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_input() Function)
15
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xcf
0xcf
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
HEAD != NULL (1st iteration)
2 22 NULL
22
INT:
in_value
2
INT:
in_ID
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_input() Function)
16
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xcf
0xcf
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 NULL
(ID, Values): (1, 11) (2, 22)
/* We will study ll_print() later */ 22
INT:
in_value
2
INT:
in_ID
HEAD != NULL (1st iteration)
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_input() Function)
17
ID value next
int int
Pointer
(NODE)
NODE
HEAD != NULL (2nd iteration)
0xf1
0xf1
0xcf
0xcf
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 NULL
33
INT:
in_value
3
INT:
in_ID
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_input() Function)
18
ID value next
int int
Pointer
(NODE)
NODE
HEAD != NULL (2nd iteration)
33
INT:
in_value
3
INT:
in_ID
0xf1
0xf1
0xcf
0xda
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 NULL
0xda
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_input() Function)
19
ID value next
int int
Pointer
(NODE)
NODE
33
INT:
in_value
3
INT:
in_ID
0xf1
0xf1
0xcf
0xda
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
HEAD != NULL (2nd iteration)
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_input() Function)
20
ID value next
int int
Pointer
(NODE)
NODE
HEAD != NULL (2nd iteration)
33
INT:
in_value
3
INT:
in_ID
0xf1
0xf1
0xcf
0xda
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 33 NULL
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_input() Function)
21
ID value next
int int
Pointer
(NODE)
NODE
HEAD != NULL (2nd iteration)
33
INT:
in_value
3
INT:
in_ID
0xf1
0xf1
0xda
0xda
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 33 NULL
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_input() Function)
22
ID value next
int int
Pointer
(NODE)
NODE
HEAD != NULL (2nd iteration)
33
INT:
in_value
3
INT:
in_ID
0xf1
0xf1
0xda
0xda
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 33 NULL
(ID, Values): (1, 11) (2, 22) (3, 33)
/* We will study ll_print() later */
Head
0xf1 0xcf 0xda NULL
Professor Joongheon Kim
https://joongheon.github.io
C Programming
• 일반화
23
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code Functions
• Linked List Sample Code
• ll_input()
• ll_print()
• ll_update()
• Ll_delete()
24
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_print() Function)
25
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xf1
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 33 NULL
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_print() Function)
26
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xf1
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 33 NULL
(ID, Values):
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_print() Function)
27
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xf1
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 33 NULL
(ID, Values): (1, 11)
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_print() Function)
28
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
oxcf
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 33 NULL
(ID, Values): (1, 11)
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_print() Function)
29
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xcf
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 33 NULL
(ID, Values): (1, 11) (2, 22)
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_print() Function)
30
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xda
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 33 NULL
(ID, Values): (1, 11) (2, 22)
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_print() Function)
31
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xda
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 33 NULL
(ID, Values): (1, 11) (2, 22) (3, 33)
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_print() Function)
32
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
NULL
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 33 NULL
(ID, Values): (1, 11) (2, 22) (3, 33)
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_print() Function)
33
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
NULL
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 33 NULL
(ID, Values): (1, 11) (2, 22) (3, 33)
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code Functions
• Linked List Sample Code
• ll_input()
• ll_print()
• ll_update()
• Ll_delete()
34
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_update() Function)
35
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xda
NULL
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 33 NULL
3
INT:
update_ID
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_update() Function)
36
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xda
0xf1
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 33 NULL
3
INT:
update_ID
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_update() Function)
37
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xda
0xf1
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 33 NULL
3
INT:
update_ID
1 != 3
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_update() Function)
38
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xda
0xcf
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 33 NULL
3
INT:
update_ID
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_update() Function)
39
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xda
0xcf
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 33 NULL
3
INT:
update_ID
2 != 3
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_update() Function)
40
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xda
0xda
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 33 NULL
3
INT:
update_ID
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_update() Function)
41
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xda
0xda
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 33 NULL
3
INT:
update_ID
3== 3
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_update() Function)
42
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xda
0xda
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 99 NULL
3
INT:
update_ID
99
INT:
update_value
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_update() Function)
43
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xda
0xda
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 99 NULL
3
INT:
update_ID
99
INT:
update_value
(ID, Values): (1, 11) (2, 22) (3, 99)
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code Functions
• Linked List Sample Code
• ll_input()
• ll_print()
• ll_update()
• Ll_delete()
44
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
45
ID value next
int int
Pointer
(NODE)
NODE
Delete the first NODE (delete_ID == 1)
0xf1
0xf1
0xda
0xda
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 99 NULL
1
INT:
delete_ID
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
46
ID value next
int int
Pointer
(NODE)
NODE
Delete the first NODE (delete_ID == 1)
0xf1
0xf1
0xda
0xf1
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 99 NULL
1
INT:
delete_ID
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
47
ID value next
int int
Pointer
(NODE)
NODE
Delete the first NODE (delete_ID == 1)
0xf1
0xf1
0xda
0xf1
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 99 NULL
1
INT:
delete_ID
1 == 1
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
48
ID value next
int int
Pointer
(NODE)
NODE
Delete the first NODE (delete_ID == 1)
0xf1
0xcf
0xda
0xf1
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 99 NULL
1
INT:
delete_ID
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
49
ID value next
int int
Pointer
(NODE)
NODE
Delete the first NODE (delete_ID == 1)
0xf1
0xcf
0xda
0xf1
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 99 NULL
1
INT:
delete_ID
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
50
ID value next
int int
Pointer
(NODE)
NODE
Delete the first NODE (delete_ID == 2 != 1)
0xf1
0xf1
0xda
0xda
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 99 NULL
2
INT:
delete_ID
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
51
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xda
0xf1
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 99 NULL
2
INT:
delete_ID
Delete the first NODE (delete_ID == 2 != 1)
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
52
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xda
0xf1
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 99 NULL
2
INT:
delete_ID
1 != 2
Delete the first NODE (delete_ID == 2 != 1)
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
53
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xda
0xf1
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 99 NULL
2
INT:
delete_ID
Delete the first NODE (delete_ID == 2 != 1)
Pointer (NODE): tmp
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
54
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xda
0xf1
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 99 NULL
Delete the first NODE (delete_ID == 2 != 1)
2
INT:
delete_ID
Pointer (NODE): tmp
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
55
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xf1
0xf1
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 99 NULL
Delete the first NODE (delete_ID == 2 != 1)
2
INT:
delete_ID
Pointer (NODE): tmp
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
56
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xf1
0xcf
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 99 NULL
Delete the first NODE (delete_ID == 2 != 1)
2
INT:
delete_ID
Pointer (NODE): tmp
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
57
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xf1
0xcf
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 99 NULL
Delete the first NODE (delete_ID == 2 != 1)
2
INT:
delete_ID
Pointer (NODE): tmp
2 == 2
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
58
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xf1
0xcf
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xda
0xcf
2 22 0xda
0xda
3 99 NULL
Delete the first NODE (delete_ID == 2 != 1)
2
INT:
delete_ID
Pointer (NODE): tmp
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
59
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xf1
0xcf
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xda
0xcf
2 22 0xda
0xda
3 99 NULL
Delete the first NODE (delete_ID == 2 != 1)
2
INT:
delete_ID
0xf1
Pointer (NODE): tmp
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
60
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xf1
0xcf
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xda
0xcf
2 22 0xda
0xda
3 99 NULL
Delete the first NODE (delete_ID == 2 != 1)
2
INT:
delete_ID
0xf1
Pointer (NODE): tmp
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
61
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xf1
0xcf
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xda
0xda
3 99 NULL
Delete the first NODE (delete_ID == 2 != 1)
2
INT:
delete_ID
0xf1
Pointer (NODE): tmp
0xda != NULL
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
62
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xf1
0xcf
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xda
0xda
3 99 NULL
Delete the first NODE (delete_ID == 2 != 1)
2
INT:
delete_ID
0xf1
Pointer (NODE): tmp
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
63
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xf1
0xcf
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xda
0xda
3 99 NULL
Delete the first NODE (delete_ID == 2 != 1)
2
INT:
delete_ID
0xda
Pointer (NODE): tmp
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
64
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xf1
0xcf
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xda
0xda
3 99 NULL
Delete the first NODE (delete_ID == 2 != 1)
2
INT:
delete_ID
0xda
Pointer (NODE): tmp
0xda != NULL
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
65
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xda
0xcf
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xda
0xda
3 99 NULL
Delete the first NODE (delete_ID == 2 != 1)
2
INT:
delete_ID
0xda
Pointer (NODE): tmp
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
66
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xda
0xcf
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xda
0xda
3 99 NULL
Delete the first NODE (delete_ID == 2 != 1)
2
INT:
delete_ID
NULL
Pointer (NODE): tmp
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
67
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xda
0xcf
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xda
0xda
3 99 NULL
Delete the first NODE (delete_ID == 2 != 1)
2
INT:
delete_ID
NULL
Pointer (NODE): tmp
NULL == NULL
Professor Joongheon Kim
https://joongheon.github.io
C Programming
68
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
69
ID value next
int int
Pointer
(NODE)
NODE
Delete the first NODE (delete_ID == 3 != 1)
0xf1
0xf1
0xda
0xda
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 99 NULL
3
INT:
delete_ID
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
70
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xda
0xf1
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 99 NULL
3
INT:
delete_ID
Delete the first NODE (delete_ID == 3 != 1)
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
71
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xda
0xf1
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 99 NULL
3
INT:
delete_ID
1 != 3
Delete the first NODE (delete_ID == 3 != 1)
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
72
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xda
0xf1
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 99 NULL
3
INT:
delete_ID
Delete the first NODE (delete_ID == 3 != 1)
Pointer (NODE): tmp
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
73
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xda
0xf1
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 99 NULL
Delete the first NODE (delete_ID == 3 != 1)
3
INT:
delete_ID
Pointer (NODE): tmp
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
74
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xf1
0xf1
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 99 NULL
Delete the first NODE (delete_ID == 3 != 1)
3
INT:
delete_ID
Pointer (NODE): tmp
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
75
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xf1
0xcf
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 99 NULL
Delete the first NODE (delete_ID == 3 != 1)
3
INT:
delete_ID
Pointer (NODE): tmp
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
76
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xf1
0xcf
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 99 NULL
Delete the first NODE (delete_ID == 3 != 1)
3
INT:
delete_ID
Pointer (NODE): tmp
2 != 3
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
77
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xcf
0xcf
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 99 NULL
Delete the first NODE (delete_ID == 3 != 1)
3
INT:
delete_ID
Pointer (NODE): tmp
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
78
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xcf
0xda
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 99 NULL
Delete the first NODE (delete_ID == 3 != 1)
3
INT:
delete_ID
Pointer (NODE): tmp
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
79
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xcf
0xda
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 0xda
0xda
3 99 NULL
Delete the first NODE (delete_ID == 3 != 1)
3
INT:
delete_ID
Pointer (NODE): tmp
3 == 3
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
80
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xcf
0xda
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 NULL
0xda
3 99 NULL
Delete the first NODE (delete_ID == 3 != 1)
3
INT:
delete_ID
Pointer (NODE): tmp
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
81
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xcf
0xda
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 NULL
0xda
3 99 NULL
Delete the first NODE (delete_ID == 3 != 1)
3
INT:
delete_ID
0xcf
Pointer (NODE): tmp
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
82
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xcf
0xda
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 NULL
0xda
3 99 NULL
Delete the first NODE (delete_ID == 3 != 1)
3
INT:
delete_ID
0xcf
Pointer (NODE): tmp
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Linked List Sample Code (ll_delete() Function)
83
ID value next
int int
Pointer
(NODE)
NODE
0xf1
0xf1
0xcf
0xda
Pointer (NODE): head
Pointer (NODE): tail
Pointer (NODE): ptr
1 11 0xcf
0xcf
2 22 NULL
Delete the first NODE (delete_ID == 3 != 1)
3
INT:
delete_ID
0xcf
Pointer (NODE): tmp
Professor Joongheon Kim
https://joongheon.github.io
C Programming
Q&A
Thank you for your attention!
• More questions?
• joongheon@korea.ac.kr
• More details?
• https://joongheon.github.io/
84

More Related Content

What's hot

Code Analysis-run time error prediction
Code Analysis-run time error predictionCode Analysis-run time error prediction
Code Analysis-run time error predictionNIKHIL NAWATHE
 
PostThis
PostThisPostThis
PostThis
testingphase
 
History of C#
History of C#History of C#
History of C#
aschlapsi
 
Aspects of software naturalness through the generation of IdentifierNames
Aspects of software naturalness through the generation of IdentifierNamesAspects of software naturalness through the generation of IdentifierNames
Aspects of software naturalness through the generation of IdentifierNames
Oleksandr Zaitsev
 
C++ idioms by example (Nov 2008)
C++ idioms by example (Nov 2008)C++ idioms by example (Nov 2008)
C++ idioms by example (Nov 2008)Olve Maudal
 
Replace OutputIterator and Extend Range
Replace OutputIterator and Extend RangeReplace OutputIterator and Extend Range
Replace OutputIterator and Extend Range
Akira Takahashi
 
Cd practical file (1) start se
Cd practical file (1) start seCd practical file (1) start se
Cd practical file (1) start se
dalipkumar64
 
Compiler Construction | Lecture 6 | Introduction to Static Analysis
Compiler Construction | Lecture 6 | Introduction to Static AnalysisCompiler Construction | Lecture 6 | Introduction to Static Analysis
Compiler Construction | Lecture 6 | Introduction to Static Analysis
Eelco Visser
 
Solid C++ by Example
Solid C++ by ExampleSolid C++ by Example
Solid C++ by Example
Olve Maudal
 
Big picture of category theory in scala with deep dive into contravariant and...
Big picture of category theory in scala with deep dive into contravariant and...Big picture of category theory in scala with deep dive into contravariant and...
Big picture of category theory in scala with deep dive into contravariant and...
Piotr Paradziński
 
Design Patterns in Modern C++
Design Patterns in Modern C++Design Patterns in Modern C++
Design Patterns in Modern C++
Dmitri Nesteruk
 
Java level 1 Quizzes
Java level 1 QuizzesJava level 1 Quizzes
Java level 1 QuizzesSteven Luo
 
TDD in C - Recently Used List Kata
TDD in C - Recently Used List KataTDD in C - Recently Used List Kata
TDD in C - Recently Used List Kata
Olve Maudal
 
An Execution-Semantic and Content-and-Context-Based Code-Clone Detection and ...
An Execution-Semantic and Content-and-Context-Based Code-Clone Detection and ...An Execution-Semantic and Content-and-Context-Based Code-Clone Detection and ...
An Execution-Semantic and Content-and-Context-Based Code-Clone Detection and ...
Kamiya Toshihiro
 
OXiGen: Automated FPGA design flow from C applications to dataflow kernels - ...
OXiGen: Automated FPGA design flow from C applications to dataflow kernels - ...OXiGen: Automated FPGA design flow from C applications to dataflow kernels - ...
OXiGen: Automated FPGA design flow from C applications to dataflow kernels - ...
NECST Lab @ Politecnico di Milano
 
Why functional programming and category theory strongly matters
Why functional programming and category theory strongly mattersWhy functional programming and category theory strongly matters
Why functional programming and category theory strongly matters
Piotr Paradziński
 
Introduction to Python for Plone developers
Introduction to Python for Plone developersIntroduction to Python for Plone developers
Introduction to Python for Plone developers
Jim Roepcke
 
Java Quiz
Java QuizJava Quiz
Java Quiz
Dharmraj Sharma
 
Insecure coding in C (and C++)
Insecure coding in C (and C++)Insecure coding in C (and C++)
Insecure coding in C (and C++)
Olve Maudal
 

What's hot (20)

Code Analysis-run time error prediction
Code Analysis-run time error predictionCode Analysis-run time error prediction
Code Analysis-run time error prediction
 
PostThis
PostThisPostThis
PostThis
 
History of C#
History of C#History of C#
History of C#
 
Aspects of software naturalness through the generation of IdentifierNames
Aspects of software naturalness through the generation of IdentifierNamesAspects of software naturalness through the generation of IdentifierNames
Aspects of software naturalness through the generation of IdentifierNames
 
C++ idioms by example (Nov 2008)
C++ idioms by example (Nov 2008)C++ idioms by example (Nov 2008)
C++ idioms by example (Nov 2008)
 
Replace OutputIterator and Extend Range
Replace OutputIterator and Extend RangeReplace OutputIterator and Extend Range
Replace OutputIterator and Extend Range
 
Cd practical file (1) start se
Cd practical file (1) start seCd practical file (1) start se
Cd practical file (1) start se
 
Compiler Construction | Lecture 6 | Introduction to Static Analysis
Compiler Construction | Lecture 6 | Introduction to Static AnalysisCompiler Construction | Lecture 6 | Introduction to Static Analysis
Compiler Construction | Lecture 6 | Introduction to Static Analysis
 
Solid C++ by Example
Solid C++ by ExampleSolid C++ by Example
Solid C++ by Example
 
Big picture of category theory in scala with deep dive into contravariant and...
Big picture of category theory in scala with deep dive into contravariant and...Big picture of category theory in scala with deep dive into contravariant and...
Big picture of category theory in scala with deep dive into contravariant and...
 
RAII and ScopeGuard
RAII and ScopeGuardRAII and ScopeGuard
RAII and ScopeGuard
 
Design Patterns in Modern C++
Design Patterns in Modern C++Design Patterns in Modern C++
Design Patterns in Modern C++
 
Java level 1 Quizzes
Java level 1 QuizzesJava level 1 Quizzes
Java level 1 Quizzes
 
TDD in C - Recently Used List Kata
TDD in C - Recently Used List KataTDD in C - Recently Used List Kata
TDD in C - Recently Used List Kata
 
An Execution-Semantic and Content-and-Context-Based Code-Clone Detection and ...
An Execution-Semantic and Content-and-Context-Based Code-Clone Detection and ...An Execution-Semantic and Content-and-Context-Based Code-Clone Detection and ...
An Execution-Semantic and Content-and-Context-Based Code-Clone Detection and ...
 
OXiGen: Automated FPGA design flow from C applications to dataflow kernels - ...
OXiGen: Automated FPGA design flow from C applications to dataflow kernels - ...OXiGen: Automated FPGA design flow from C applications to dataflow kernels - ...
OXiGen: Automated FPGA design flow from C applications to dataflow kernels - ...
 
Why functional programming and category theory strongly matters
Why functional programming and category theory strongly mattersWhy functional programming and category theory strongly matters
Why functional programming and category theory strongly matters
 
Introduction to Python for Plone developers
Introduction to Python for Plone developersIntroduction to Python for Plone developers
Introduction to Python for Plone developers
 
Java Quiz
Java QuizJava Quiz
Java Quiz
 
Insecure coding in C (and C++)
Insecure coding in C (and C++)Insecure coding in C (and C++)
Insecure coding in C (and C++)
 

Similar to C Programming: Linked List (Examples)

Ida python intro
Ida python introIda python intro
Ida python intro
小静 安
 
sonam Kumari python.ppt
sonam Kumari python.pptsonam Kumari python.ppt
sonam Kumari python.ppt
ssuserd64918
 
Profiling and optimization
Profiling and optimizationProfiling and optimization
Profiling and optimizationg3_nittala
 
C# / Java Language Comparison
C# / Java Language ComparisonC# / Java Language Comparison
C# / Java Language Comparison
Robert Bachmann
 
Complicated declarations in c
Complicated declarations in cComplicated declarations in c
Complicated declarations in c
Rahul Budholiya
 
Pointcuts and Analysis
Pointcuts and AnalysisPointcuts and Analysis
Pointcuts and AnalysisWiwat Ruengmee
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generation
Dr.DHANALAKSHMI SENTHILKUMAR
 
Introduction to phyton , important topic
Introduction to phyton , important topicIntroduction to phyton , important topic
Introduction to phyton , important topic
akpgenious67
 
Functions.docx
Functions.docxFunctions.docx
Functions.docx
VandanaGoyal21
 
Python programming workshop session 1
Python programming workshop session 1Python programming workshop session 1
Python programming workshop session 1
Abdul Haseeb
 
Introduction to Python Programming
Introduction to Python ProgrammingIntroduction to Python Programming
Introduction to Python Programming
VijaySharma802
 
Object Oriented Technologies
Object Oriented TechnologiesObject Oriented Technologies
Object Oriented Technologies
Umesh Nikam
 
Advanced Web Technology ass.pdf
Advanced Web Technology ass.pdfAdvanced Web Technology ass.pdf
Advanced Web Technology ass.pdf
simenehanmut
 
Designing Architecture-aware Library using Boost.Proto
Designing Architecture-aware Library using Boost.ProtoDesigning Architecture-aware Library using Boost.Proto
Designing Architecture-aware Library using Boost.Proto
Joel Falcou
 
Introduction to Python Programming | InsideAIML
Introduction to Python Programming | InsideAIMLIntroduction to Python Programming | InsideAIML
Introduction to Python Programming | InsideAIML
VijaySharma802
 
MODULE. .pptx
MODULE.                              .pptxMODULE.                              .pptx
MODULE. .pptx
Alpha337901
 
19. Java data structures algorithms and complexity
19. Java data structures algorithms and complexity19. Java data structures algorithms and complexity
19. Java data structures algorithms and complexity
Intro C# Book
 
Programming in c function
Programming in c functionProgramming in c function
Programming in c function
Parvez Ahmed
 
Clojure: Simple By Design
Clojure: Simple By DesignClojure: Simple By Design
Clojure: Simple By Design
All Things Open
 

Similar to C Programming: Linked List (Examples) (20)

Ida python intro
Ida python introIda python intro
Ida python intro
 
sonam Kumari python.ppt
sonam Kumari python.pptsonam Kumari python.ppt
sonam Kumari python.ppt
 
Profiling and optimization
Profiling and optimizationProfiling and optimization
Profiling and optimization
 
C# / Java Language Comparison
C# / Java Language ComparisonC# / Java Language Comparison
C# / Java Language Comparison
 
Complicated declarations in c
Complicated declarations in cComplicated declarations in c
Complicated declarations in c
 
Pointcuts and Analysis
Pointcuts and AnalysisPointcuts and Analysis
Pointcuts and Analysis
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generation
 
Introduction to phyton , important topic
Introduction to phyton , important topicIntroduction to phyton , important topic
Introduction to phyton , important topic
 
Functions.docx
Functions.docxFunctions.docx
Functions.docx
 
Python programming workshop session 1
Python programming workshop session 1Python programming workshop session 1
Python programming workshop session 1
 
Introduction to Python Programming
Introduction to Python ProgrammingIntroduction to Python Programming
Introduction to Python Programming
 
C
CC
C
 
Object Oriented Technologies
Object Oriented TechnologiesObject Oriented Technologies
Object Oriented Technologies
 
Advanced Web Technology ass.pdf
Advanced Web Technology ass.pdfAdvanced Web Technology ass.pdf
Advanced Web Technology ass.pdf
 
Designing Architecture-aware Library using Boost.Proto
Designing Architecture-aware Library using Boost.ProtoDesigning Architecture-aware Library using Boost.Proto
Designing Architecture-aware Library using Boost.Proto
 
Introduction to Python Programming | InsideAIML
Introduction to Python Programming | InsideAIMLIntroduction to Python Programming | InsideAIML
Introduction to Python Programming | InsideAIML
 
MODULE. .pptx
MODULE.                              .pptxMODULE.                              .pptx
MODULE. .pptx
 
19. Java data structures algorithms and complexity
19. Java data structures algorithms and complexity19. Java data structures algorithms and complexity
19. Java data structures algorithms and complexity
 
Programming in c function
Programming in c functionProgramming in c function
Programming in c function
 
Clojure: Simple By Design
Clojure: Simple By DesignClojure: Simple By Design
Clojure: Simple By Design
 

Recently uploaded

Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
Kamal Acharya
 
Explosives Industry manufacturing process.pdf
Explosives Industry manufacturing process.pdfExplosives Industry manufacturing process.pdf
Explosives Industry manufacturing process.pdf
884710SadaqatAli
 
Toll tax management system project report..pdf
Toll tax management system project report..pdfToll tax management system project report..pdf
Toll tax management system project report..pdf
Kamal Acharya
 
calpeda Water Efficient and Effective Pump.pptx
calpeda Water Efficient and Effective Pump.pptxcalpeda Water Efficient and Effective Pump.pptx
calpeda Water Efficient and Effective Pump.pptx
calpedapumpindia
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
Kamal Acharya
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
fluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answerfluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answer
apareshmondalnita
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 

Recently uploaded (20)

Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
 
Explosives Industry manufacturing process.pdf
Explosives Industry manufacturing process.pdfExplosives Industry manufacturing process.pdf
Explosives Industry manufacturing process.pdf
 
Toll tax management system project report..pdf
Toll tax management system project report..pdfToll tax management system project report..pdf
Toll tax management system project report..pdf
 
calpeda Water Efficient and Effective Pump.pptx
calpeda Water Efficient and Effective Pump.pptxcalpeda Water Efficient and Effective Pump.pptx
calpeda Water Efficient and Effective Pump.pptx
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
fluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answerfluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answer
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 

C Programming: Linked List (Examples)

  • 1. Professor Joongheon Kim https://joongheon.github.io C Programming C Programming Linked List (Examples) Prof. Joongheon Kim Korea University, School of Electrical Engineering Artificial Intelligence and Mobility Laboratory https://joongheon.github.io joongheon@korea.ac.kr
  • 2. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (Main Function) 2 ID value next int int Pointer (NODE) NODE Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr
  • 3. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (Main Function) 3 ID value next int int Pointer (NODE) NODE NULL Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr
  • 4. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code Functions • Linked List Sample Code • ll_input() • ll_print() • ll_update() • Ll_delete() 4
  • 5. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_input() Function) 5 ID value next int int Pointer (NODE) NODE NULL Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr HEAD == NULL 11 INT: in_value 1 INT: in_ID
  • 6. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_input() Function) 6 ID value next int int Pointer (NODE) NODE HEAD == NULL NODE 0xf1 NULL 0xf1 Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 11 INT: in_value 1 INT: in_ID
  • 7. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_input() Function) 7 ID value next int int Pointer (NODE) NODE HEAD == NULL NODE 0xf1 0xf1 0xf1 Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 11 INT: in_value 1 INT: in_ID
  • 8. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_input() Function) 8 ID value next int int Pointer (NODE) NODE HEAD == NULL 0xf1 0xf1 0xf1 Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 NULL 11 INT: in_value 1 INT: in_ID
  • 9. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_input() Function) 9 ID value next int int Pointer (NODE) NODE HEAD == NULL 0xf1 0xf1 0xf1 0xf1 Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 NULL 11 INT: in_value 1 INT: in_ID
  • 10. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_input() Function) 10 ID value next int int Pointer (NODE) NODE HEAD == NULL 0xf1 0xf1 0xf1 0xf1 Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 NULL (ID, Values): (1, 11) /* We will study print() later */ 11 INT: in_value 1 INT: in_ID
  • 11. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_input() Function) 11 ID value next int int Pointer (NODE) NODE HEAD != NULL (1st iteration) 0xf1 0xf1 0xf1 0xf1 Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 NULL 22 INT: in_value 2 INT: in_ID
  • 12. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_input() Function) 12 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xf1 0xcf Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 NULL 0xcf HEAD != NULL (1st iteration) 22 INT: in_value 2 INT: in_ID
  • 13. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_input() Function) 13 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xf1 0xcf Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf HEAD != NULL (1st iteration) 22 INT: in_value 2 INT: in_ID
  • 14. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_input() Function) 14 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xf1 0xcf Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf HEAD != NULL (1st iteration) 2 22 NULL 22 INT: in_value 2 INT: in_ID
  • 15. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_input() Function) 15 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xcf 0xcf Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf HEAD != NULL (1st iteration) 2 22 NULL 22 INT: in_value 2 INT: in_ID
  • 16. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_input() Function) 16 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xcf 0xcf Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 NULL (ID, Values): (1, 11) (2, 22) /* We will study ll_print() later */ 22 INT: in_value 2 INT: in_ID HEAD != NULL (1st iteration)
  • 17. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_input() Function) 17 ID value next int int Pointer (NODE) NODE HEAD != NULL (2nd iteration) 0xf1 0xf1 0xcf 0xcf Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 NULL 33 INT: in_value 3 INT: in_ID
  • 18. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_input() Function) 18 ID value next int int Pointer (NODE) NODE HEAD != NULL (2nd iteration) 33 INT: in_value 3 INT: in_ID 0xf1 0xf1 0xcf 0xda Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 NULL 0xda
  • 19. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_input() Function) 19 ID value next int int Pointer (NODE) NODE 33 INT: in_value 3 INT: in_ID 0xf1 0xf1 0xcf 0xda Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda HEAD != NULL (2nd iteration)
  • 20. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_input() Function) 20 ID value next int int Pointer (NODE) NODE HEAD != NULL (2nd iteration) 33 INT: in_value 3 INT: in_ID 0xf1 0xf1 0xcf 0xda Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 33 NULL
  • 21. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_input() Function) 21 ID value next int int Pointer (NODE) NODE HEAD != NULL (2nd iteration) 33 INT: in_value 3 INT: in_ID 0xf1 0xf1 0xda 0xda Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 33 NULL
  • 22. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_input() Function) 22 ID value next int int Pointer (NODE) NODE HEAD != NULL (2nd iteration) 33 INT: in_value 3 INT: in_ID 0xf1 0xf1 0xda 0xda Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 33 NULL (ID, Values): (1, 11) (2, 22) (3, 33) /* We will study ll_print() later */ Head 0xf1 0xcf 0xda NULL
  • 24. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code Functions • Linked List Sample Code • ll_input() • ll_print() • ll_update() • Ll_delete() 24
  • 25. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_print() Function) 25 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xf1 Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 33 NULL
  • 26. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_print() Function) 26 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xf1 Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 33 NULL (ID, Values):
  • 27. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_print() Function) 27 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xf1 Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 33 NULL (ID, Values): (1, 11)
  • 28. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_print() Function) 28 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 oxcf Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 33 NULL (ID, Values): (1, 11)
  • 29. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_print() Function) 29 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xcf Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 33 NULL (ID, Values): (1, 11) (2, 22)
  • 30. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_print() Function) 30 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xda Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 33 NULL (ID, Values): (1, 11) (2, 22)
  • 31. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_print() Function) 31 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xda Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 33 NULL (ID, Values): (1, 11) (2, 22) (3, 33)
  • 32. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_print() Function) 32 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 NULL Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 33 NULL (ID, Values): (1, 11) (2, 22) (3, 33)
  • 33. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_print() Function) 33 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 NULL Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 33 NULL (ID, Values): (1, 11) (2, 22) (3, 33)
  • 34. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code Functions • Linked List Sample Code • ll_input() • ll_print() • ll_update() • Ll_delete() 34
  • 35. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_update() Function) 35 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xda NULL Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 33 NULL 3 INT: update_ID
  • 36. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_update() Function) 36 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xda 0xf1 Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 33 NULL 3 INT: update_ID
  • 37. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_update() Function) 37 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xda 0xf1 Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 33 NULL 3 INT: update_ID 1 != 3
  • 38. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_update() Function) 38 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xda 0xcf Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 33 NULL 3 INT: update_ID
  • 39. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_update() Function) 39 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xda 0xcf Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 33 NULL 3 INT: update_ID 2 != 3
  • 40. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_update() Function) 40 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xda 0xda Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 33 NULL 3 INT: update_ID
  • 41. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_update() Function) 41 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xda 0xda Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 33 NULL 3 INT: update_ID 3== 3
  • 42. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_update() Function) 42 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xda 0xda Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 99 NULL 3 INT: update_ID 99 INT: update_value
  • 43. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_update() Function) 43 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xda 0xda Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 99 NULL 3 INT: update_ID 99 INT: update_value (ID, Values): (1, 11) (2, 22) (3, 99)
  • 44. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code Functions • Linked List Sample Code • ll_input() • ll_print() • ll_update() • Ll_delete() 44
  • 45. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 45 ID value next int int Pointer (NODE) NODE Delete the first NODE (delete_ID == 1) 0xf1 0xf1 0xda 0xda Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 99 NULL 1 INT: delete_ID
  • 46. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 46 ID value next int int Pointer (NODE) NODE Delete the first NODE (delete_ID == 1) 0xf1 0xf1 0xda 0xf1 Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 99 NULL 1 INT: delete_ID
  • 47. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 47 ID value next int int Pointer (NODE) NODE Delete the first NODE (delete_ID == 1) 0xf1 0xf1 0xda 0xf1 Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 99 NULL 1 INT: delete_ID 1 == 1
  • 48. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 48 ID value next int int Pointer (NODE) NODE Delete the first NODE (delete_ID == 1) 0xf1 0xcf 0xda 0xf1 Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 99 NULL 1 INT: delete_ID
  • 49. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 49 ID value next int int Pointer (NODE) NODE Delete the first NODE (delete_ID == 1) 0xf1 0xcf 0xda 0xf1 Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 99 NULL 1 INT: delete_ID
  • 50. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 50 ID value next int int Pointer (NODE) NODE Delete the first NODE (delete_ID == 2 != 1) 0xf1 0xf1 0xda 0xda Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 99 NULL 2 INT: delete_ID
  • 51. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 51 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xda 0xf1 Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 99 NULL 2 INT: delete_ID Delete the first NODE (delete_ID == 2 != 1)
  • 52. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 52 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xda 0xf1 Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 99 NULL 2 INT: delete_ID 1 != 2 Delete the first NODE (delete_ID == 2 != 1)
  • 53. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 53 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xda 0xf1 Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 99 NULL 2 INT: delete_ID Delete the first NODE (delete_ID == 2 != 1) Pointer (NODE): tmp
  • 54. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 54 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xda 0xf1 Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 99 NULL Delete the first NODE (delete_ID == 2 != 1) 2 INT: delete_ID Pointer (NODE): tmp
  • 55. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 55 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xf1 0xf1 Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 99 NULL Delete the first NODE (delete_ID == 2 != 1) 2 INT: delete_ID Pointer (NODE): tmp
  • 56. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 56 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xf1 0xcf Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 99 NULL Delete the first NODE (delete_ID == 2 != 1) 2 INT: delete_ID Pointer (NODE): tmp
  • 57. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 57 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xf1 0xcf Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 99 NULL Delete the first NODE (delete_ID == 2 != 1) 2 INT: delete_ID Pointer (NODE): tmp 2 == 2
  • 58. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 58 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xf1 0xcf Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xda 0xcf 2 22 0xda 0xda 3 99 NULL Delete the first NODE (delete_ID == 2 != 1) 2 INT: delete_ID Pointer (NODE): tmp
  • 59. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 59 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xf1 0xcf Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xda 0xcf 2 22 0xda 0xda 3 99 NULL Delete the first NODE (delete_ID == 2 != 1) 2 INT: delete_ID 0xf1 Pointer (NODE): tmp
  • 60. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 60 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xf1 0xcf Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xda 0xcf 2 22 0xda 0xda 3 99 NULL Delete the first NODE (delete_ID == 2 != 1) 2 INT: delete_ID 0xf1 Pointer (NODE): tmp
  • 61. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 61 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xf1 0xcf Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xda 0xda 3 99 NULL Delete the first NODE (delete_ID == 2 != 1) 2 INT: delete_ID 0xf1 Pointer (NODE): tmp 0xda != NULL
  • 62. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 62 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xf1 0xcf Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xda 0xda 3 99 NULL Delete the first NODE (delete_ID == 2 != 1) 2 INT: delete_ID 0xf1 Pointer (NODE): tmp
  • 63. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 63 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xf1 0xcf Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xda 0xda 3 99 NULL Delete the first NODE (delete_ID == 2 != 1) 2 INT: delete_ID 0xda Pointer (NODE): tmp
  • 64. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 64 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xf1 0xcf Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xda 0xda 3 99 NULL Delete the first NODE (delete_ID == 2 != 1) 2 INT: delete_ID 0xda Pointer (NODE): tmp 0xda != NULL
  • 65. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 65 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xda 0xcf Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xda 0xda 3 99 NULL Delete the first NODE (delete_ID == 2 != 1) 2 INT: delete_ID 0xda Pointer (NODE): tmp
  • 66. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 66 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xda 0xcf Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xda 0xda 3 99 NULL Delete the first NODE (delete_ID == 2 != 1) 2 INT: delete_ID NULL Pointer (NODE): tmp
  • 67. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 67 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xda 0xcf Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xda 0xda 3 99 NULL Delete the first NODE (delete_ID == 2 != 1) 2 INT: delete_ID NULL Pointer (NODE): tmp NULL == NULL
  • 69. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 69 ID value next int int Pointer (NODE) NODE Delete the first NODE (delete_ID == 3 != 1) 0xf1 0xf1 0xda 0xda Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 99 NULL 3 INT: delete_ID
  • 70. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 70 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xda 0xf1 Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 99 NULL 3 INT: delete_ID Delete the first NODE (delete_ID == 3 != 1)
  • 71. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 71 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xda 0xf1 Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 99 NULL 3 INT: delete_ID 1 != 3 Delete the first NODE (delete_ID == 3 != 1)
  • 72. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 72 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xda 0xf1 Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 99 NULL 3 INT: delete_ID Delete the first NODE (delete_ID == 3 != 1) Pointer (NODE): tmp
  • 73. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 73 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xda 0xf1 Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 99 NULL Delete the first NODE (delete_ID == 3 != 1) 3 INT: delete_ID Pointer (NODE): tmp
  • 74. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 74 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xf1 0xf1 Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 99 NULL Delete the first NODE (delete_ID == 3 != 1) 3 INT: delete_ID Pointer (NODE): tmp
  • 75. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 75 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xf1 0xcf Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 99 NULL Delete the first NODE (delete_ID == 3 != 1) 3 INT: delete_ID Pointer (NODE): tmp
  • 76. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 76 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xf1 0xcf Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 99 NULL Delete the first NODE (delete_ID == 3 != 1) 3 INT: delete_ID Pointer (NODE): tmp 2 != 3
  • 77. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 77 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xcf 0xcf Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 99 NULL Delete the first NODE (delete_ID == 3 != 1) 3 INT: delete_ID Pointer (NODE): tmp
  • 78. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 78 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xcf 0xda Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 99 NULL Delete the first NODE (delete_ID == 3 != 1) 3 INT: delete_ID Pointer (NODE): tmp
  • 79. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 79 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xcf 0xda Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 0xda 0xda 3 99 NULL Delete the first NODE (delete_ID == 3 != 1) 3 INT: delete_ID Pointer (NODE): tmp 3 == 3
  • 80. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 80 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xcf 0xda Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 NULL 0xda 3 99 NULL Delete the first NODE (delete_ID == 3 != 1) 3 INT: delete_ID Pointer (NODE): tmp
  • 81. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 81 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xcf 0xda Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 NULL 0xda 3 99 NULL Delete the first NODE (delete_ID == 3 != 1) 3 INT: delete_ID 0xcf Pointer (NODE): tmp
  • 82. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 82 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xcf 0xda Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 NULL 0xda 3 99 NULL Delete the first NODE (delete_ID == 3 != 1) 3 INT: delete_ID 0xcf Pointer (NODE): tmp
  • 83. Professor Joongheon Kim https://joongheon.github.io C Programming Linked List Sample Code (ll_delete() Function) 83 ID value next int int Pointer (NODE) NODE 0xf1 0xf1 0xcf 0xda Pointer (NODE): head Pointer (NODE): tail Pointer (NODE): ptr 1 11 0xcf 0xcf 2 22 NULL Delete the first NODE (delete_ID == 3 != 1) 3 INT: delete_ID 0xcf Pointer (NODE): tmp
  • 84. Professor Joongheon Kim https://joongheon.github.io C Programming Q&A Thank you for your attention! • More questions? • joongheon@korea.ac.kr • More details? • https://joongheon.github.io/ 84