Professional Documents
Culture Documents
CS1231 Cheat Sheet 2
CS1231 Cheat Sheet 2
Example
( )
incidence
LIST Prims Algorithm (1) Choose any edge with min weight (2) Among adjacent vertices, choose one of minimum weight (3) Stop when we have edges Kruskals Algorithm
(1) Sort all edges in order of increasing weight (2) Select the edges s.t. it joins two distinct components (3) Stop when after edges
(1)
MATRIX
adj
(3)
Chapter 7: Graphs
Euclidean Algorithm
int gcd(int a, int b) { Int temp ;
Type
Simple Graph Multigraph Pseudograph
By extension,
Edges
Undirected Undirected Undirected
Multiple Edges?
No Yes Yes
Loops?
No No Yes
A path is a CIRCUIT if A path or circuit is SIMPLE if the edges it passes are pairwise distinct An EULER CIRCUIT is a simple circuit that contains every vertex edge A connected graph has Euler circuit iff every vertex is of even deg An EULER PATH is a simple path which is not a circuit and contains all the edges and vertices all vertices, but two, have even degrees.
} }
Reverse Euclidean
An
exactly m children. An ORDERED ROOTED TREE is a rooted tree in which children of each vertex are ordered. E.g. for T2, the left subtree of is the subtree rooted at while the right subtree if a single vertex
Edges with
as initial vertex
Tree with vertices has at least two vertices of degree 1 Tree with vertices has edges sum of deg A full -ary tree internal vertex has vertices Suppose full -ary tree with vertices, internal vertices and leaves, then
A rooted -ary tree of height is BALANCED if all leaves are at level or In an -ary tree there are at most vertices at level . If the height is , there are at most leaves.