lecture 18 cse 331 oct 11, 2010. mid term next monday in class
Post on 22-Dec-2015
215 views
TRANSCRIPT
Mid term entry
Has been posted on the blog
Don’t read too much into the contentof the sample mid-term
On Friday, Oct 15
hours-a-thon
Atri: 2:00-3:30 (Bell 123)
Jeff: 3:30-5:00 (Commons 9)Alex: 5:00-6:30 (Bell 224)
Feedback forms
Am still going through them
Images are more confusing then exact definitions
Lectures are vague (not precise/well planned)
Graph representations
Adjacency matrix
0
1
1
1
0
0
1
0
0
Adjacency List
(u,v) in E?O(1) O(n) [ O(nv) ]
All neighbors of u?O(n) O(nu)
Space?O(n2) O(m+n)
Better for sparse graphs and traversals
Better for sparse graphs and traversals
2 # edges = sum of # neighbors
2m = Σ u in V nu
Give 2 pennies to each edge
u v
Rest of the graph
Rest of the graph
nu=4
nv=3Total # of pennies = 2m
Each edges gives one penny to its end points
# of pennies u receives = nu