Download presentation
Presentation is loading. Please wait.
1
Lecture 18 CSE 331 Oct 11, 2010
2
Mid term Next Monday in class
3
Mid term entry Has been posted on the blog Don’t read too much into the content of the sample mid-term
4
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)
5
Feedback forms Am still going through them Images are more confusing then exact definitions Lectures are vague (not precise/well planned)
6
Graph representations Adjacency matrix 0 1 1 1 0 0 1 0 0 Adjacency List (u,v) in E? O(1)O(n) [ O(n v ) ] All neighbors of u? O(n)O(n u ) Space?O(n 2 )O(m+n) Better for sparse graphs and traversals
7
2 # edges = sum of # neighbors 2m = Σ u in V n u Give 2 pennies to each edge u v Rest of the graph n u =4 n v =3 Total # of pennies = 2m Each edges gives one penny to its end points # of pennies u receives = n u
8
Questions?
9
Today’s agenda Run-time analysis of BFS
10
Breadth First Search (BFS) Build layers of vertices connected to s L 0 = {s} Assume L 0,..,L j have been constructed L j+1 set of vertices not chosen yet but are connected to L j Stop when new layer is empty
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.