Please enable JavaScript.
Coggle requires JavaScript to display documents.
Math (Final) - Coggle Diagram
Math (Final)
GRAPH
-
-
-
spec
walk
any vertex, any edge
can repeat
-
path
no vertex, no edge repeat
-
subgraph
have some vetex, some edge of V
spanning subgraph
have ALL vertex, but some edge
tree
connected
no cycle
V and E
Search Algro
BFS
Breath First Search
- visit all edge around v1, finished, then v2
-
-
BST
Pre-order
write root,
go to left write,
go to right, write
go to unvisit
見乜寫乜
in-order
vist most left, write
revisit root, write
visit right, then most left again....
some-order
go to deepest left, write
go to right, revisit left (write all things again)
write the root
(must need graph and cancel LRL to help)
Post-order
visit most L,
visit most R,
no choice, write
Sort
Merge sort
no. of sort:smallest:
min(n1, n2)
-
using Huffsman for more list
and find max, min no, of comparison
insertion sort
take one from stack,
put compare each ele in the temp stack
spec: increase comparison for each round
expection: if the latest no. is small, can save so round
selection sort
- find the min no. by compare it
with every one in the array
- swap the smallest with first element
spec: 10ele, must be 9+8+7....45times o(n^2)
Zip
-
zip variable codeword
-
more freq use, shorter codeword
binary tree
weight 1(1) +... 4(3) + 5(3)
huffsman
- sort weight and freq
A5 N4 D2 ...
-
-
-
-
-
-