Graphs
A Graph G = (V, E) consists of V, a nonempty set of vertices
(or nodes) and E, a set of edges. Each edge has either one
or two vertices associated with it, called its endpoints. An
edge is said to connect its endpoints.
Denver
Chicago
LA
No two dif

9.3 Representing Graphs
Vertex
Adjacent Vertices
-u1
u2, u5
u2
u1, u3, u4
u3
u2, u4
u4
u2, u3, u5
u5
u1, u2, u4
Adjacency list
Adjacency Matrix
Order the vertices in some way
V1, V2, ., Vn , the adjacency matrix is an n-by-n
matrix
Vertices
Edges
Determin

Recursive Algorithm (4.4)
An algorithm is called recursive if it solves a problem by
reducing it to an instance of the same problem with smaller
input.
Example: Computing n!
Procedure factorial ( n : nonnegative integer)
if n= 0 then factorial(n)=1
else f

1. Quiz 5 due tomorrow afternoon in E309 from
1pm to 4pm.
2. Homework grades will be based on ten graded
homework assignments (dropping the lowest
one).
3. Final Exam will be on Thursday April 30,
12:30pm to 2:30pm.
4. Review problems (for the final) will

3.3 Complexity of Algorithms
Linear Search Algorithm
Determine if 3 is in the following lists
A= cfw_ 1 4 8 -1 2
B= cfw_ 3 4 8 6 5
C= cfw_ 1 2 4 9 10 11 12 14 19 10 -11 0
D= cfw_ 1 3 2 4
For each list ( problem ), how much time will the
algorithm tak

V1
V2
No edges between vertices in V1 or V2
This is a bipartite graph but not a complete
bipartite graph ( so it is NOT K6, 4 ).
b
a
c
g
f
e
cfw_a, b, d , cfw_c, e, f, g
K3, 4
How many vertices and edges in Km, n?
d
If a is in V1, then, b, d, e must be in

COT3100: Strong Induction (Sec 4.2)
If you know how to
Slup I: + I
Slap 5'
0 Reach the first step of a ladder
0 Reach step ls + 1, if we can reach all the first
If steps
Then, you can reach any step of the ladder.
1: can reach
step I
COT3100: Applic