-
CH05 Graph
-
define
- vertices,頂點
- edges,邊
- adjacent,相鄰
- path
- cycle,環路
- subgraph
- connected graph
-
degree
- indegree
- outdegree
-
undirected graph
- connected graph
- complete graph
-
directed graph
- head
- tail
- strongly connected graph
- complete graph
-
adjacency matrix
-
無向圖
- 一定是對稱矩陣
-
有向圖
- 不一定是對稱矩陣
- 對角線一定為零
-
adjacency list
-
無向圖
-
總節點數是邊數兩倍
- 因為是雙向
-
有向圖
- 總節點數等於邊數
- weighted graph
-
traversal
-
Breadth First Search
-
水波
- queue
-
Depth First Search
-
河流
- stack
-
spanning tree
- kruskal 演算法
- prim 演算法
-
Short Path
-
Dijkstra
- Cost[V][V]
- Dist[V]
- Prior[V]
- Decided[V]
-
Floyd
- A[0]
- P[0]
-
CH06 Tree
-
tree
-
internal node
-
non-terminal node
- branch
-
external node
-
terminal node
- leaf
- parent node
-
child node
- siblings
-
level
- hight
- forest
-
binary tree
- V=E+1
- 2 children
-
level i
- 2^(i-1)
-
hight k
- (2^k) -1
- full binary tree
- formal binary tree
- complete binary tree
-
store
- one dimensional array
- linked list
-
creation of binary tree
- ABDH000E00CF00G00
-
binary tree traversals
-
preorder traverse
- ABC
-
inorder traverse
- BAC
-
postorder traverse
- BCA