9. createList
리스트 생성
deleteList
리스트 삭제
isFull
리스트의 여유 공간이 있는가?
addElement
리스트 내 특정 위치에 원소 추가
removeElement
리스트 내 특정 위치의 원소 제거
clearList
리스트 내 모든 원소 제거
getListLength
리스트 내 원소의 수
getElement
리스트 내 특정 위치의 원소
Total Issue
LIST INTRO
ALGORITHM
10. 1 2 3 4
Two Kinds of List
1 2 3 4 5
0 1 2 3 4
6
5
LIST INTRO
ALGORITHM
11. Array List
1 2 3 4 5
0 1 2 3 4
6
5
LIST ARRAY LIST
ALGORITHM
12. 최대 원소 개수
(maxElementCount)
현재 원소 개수
(CurrentElementCount)
원소 배열 포인터
(pElement)
ArrayList
data data data data …
0 1 2 3 …
data
(maxElementCount – 1)
원소
(data)
ArrayListNode
Two Structures
LIST ARRAY LIST
ALGORITHM
13. data data … data
0 1 …
curElementCount – 1
원소 추가 가능
Insert Range
LIST ARRAY LIST
ALGORITHM
14. Push and Insert
LIST ARRAY LIST
data 1 2 3 4
curElementCount – 1
position position + 1
ALGORITHM
15. Push and Insert
LIST ARRAY LIST
data 1 2 3 4 4
curElementCount – 1
position position + 1
ALGORITHM
16. Push and Insert
LIST ARRAY LIST
data 1 2 3 3 4
curElementCount – 1
position position + 1
ALGORITHM
17. Push and Insert
LIST ARRAY LIST
data 1 2 2 3 4
curElementCount – 1
position position + 1
ALGORITHM
18. Push and Insert
LIST ARRAY LIST
data 1 1 2 3 4
curElementCount – 1
position position + 1
ALGORITHM
19. Push and Insert
LIST ARRAY LIST
data 1 1 2 3 4
new
curElementCount – 1
ALGORITHM
20. Delete and Pull
LIST ARRAY LIST
data 0 1 2 3 4
1 curElementCount – 1
position position + 1
ALGORITHM
21. Delete and Pull
LIST ARRAY LIST
data 0 2 2 3 4
curElementCount – 1
position position + 1
ALGORITHM
1
22. Delete and Pull
LIST ARRAY LIST
data 0 2 3 3 4
curElementCount – 1
position position + 1
ALGORITHM
1
23. Delete and Pull
LIST ARRAY LIST
data 0 2 3 4 4
curElementCount – 1
position position + 1
ALGORITHM
1
24. Delete and Pull
LIST ARRAY LIST
data 0 2 3 4
curElementCount – 1
position position + 1
ALGORITHM
1
25. Delete and Pull
LIST ARRAY LIST
data 0 2 3 4
curElementCount – 1
position position + 1
ALGORITHM
1
return
30. Two Structures
LIST LINKED LIST
현재 원소 개수
(CurrentElementCount)
LinkedList
data
pLink
Header Node
data
pLink
ListNode
ListNode
ALGORITHM
31. LIST LINKED LIST
Insert Node
LinkedList
data
pLink
Header Node
data
pLink
position-1
data
pLink
position
…
data
pLink
newNode
ALGORITHM
32. LIST LINKED LIST
Insert Node
LinkedList
data
pLink
Header Node
data
pLink
position-1
data
pLink
position
…
data
pLink
newNode
ALGORITHM
33. LIST LINKED LIST
Insert Node
LinkedList
data
pLink
Header Node
data
pLink
position-1
data
pLink
position
…
data
pLink
newNode
ALGORITHM
34. LIST LINKED LIST
Delete Node
LinkedList
data
pLink
Header Node
data
pLink
position-1
data
pLink
position+1
…
data
pLink
position
ALGORITHM
35. LIST LINKED LIST
Delete Node
LinkedList
data
pLink
Header Node
data
pLink
position-1
data
pLink
position+1
…
data
pLink
position
ALGORITHM
36. LIST LINKED LIST
Delete Node
LinkedList
data
pLink
Header Node
data
pLink
position-1
data
pLink
position+1
…
data
pLink
position
ALGORITHM
NULL
37. LIST LINKED LIST
Delete Node
LinkedList
data
pLink
Header Node
data
pLink
position-1
data
pLink
position+1
…
data
pLink
position
ALGORITHM
NULL
return