This preview shows pages 1–24. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Announcements:
MP 6 regrade window closes tonight. 11 :59p. Late penalty waived.
MP7 available. Due soon. Start now. Today: graphs, but first... Disjoint Sets ADT: U m‘gn . F '
(“I } nning times)
) . Path Compression: mart mans Path Compression: int DS::Find(int i) I
it (3(1] < 0) return 1: else return : Find(s[i]):
} ——' r  void DS::UnionBySizo(int rootl. int toot2) ( int nchizo  slrootlloslrootzlt
_ it (isBiqqor(root1.toot2)) I slzootzl rootl;
slrootll nowSizc:
1
also {
clrootl]  rootZ:
clrootzl nousizo: Trace the code below.
Use Path Compression. Union by Height. and a pencil. If (Find(A) != Find(B) Union (Find (A) , Find (B) ) :
If (Find(D) ! Find(E) 9
Union(Find(D),Find(E)); If (Find(A) ! Find(C)
Union (Find (A) ,Find (C) ) :
If (Find(C) != Find(B)
Union(Find(C).Find(B)): If (Find(B) ! Find(F)) Union (Find (8) ,Find(F) ) 3 © (é) é
If (Find(D) ! Find(F)) Union (Find (D) .Find(F) ) 0. What‘s the tree height of the final tree? Name the last 4 data structures we‘ve discussed:
Which of those 4 islare dictionaries? Give 2 applications of a Heap: What's the buildHeap algorithm and how fast is it? The umernet. 2003
CS Networking Discovery:
wmm muttr Is most (natal? IOW: thh vmtnx has mm)ch
muggy? Shared stage time by
. characters in the play
Titus Andronicus' CS: Informatics? Discovery: Suppose a sword must be how by
an octet on stage at all times
What Is the smallest set 0! actors you could select so as to assure
. that there is aMays someone on stage who can hotd the sword? . IOW:
Findavenex ooverinthegtaph
. EAS or
)M'm W”)
© 9 M W) M
. ‘VO ‘3‘ M ‘ 0» CO
vU‘h'P. Maeve‘s Friends
CS: HCI Discovery: Find the Is! otpoqale who are
my Month' Month. but no!
nine. IOW:
Given a vertax 5. ﬁnd all vowoos whose 3mm»!
distame Is 2 from s. @or HARD? cO I! Rush Hour CS: State diagram Discovety:
Find me samba d (we!
"DVDS. IOW: Find them pom
' ' n' 't 2 @ HARD? This graph can be used to quickly
calculate whether a given number is
divisible by 7. 1.Start at the circle node at the top. 2.For each digit d in the given
number. follow d blue (solid) edges in
succession. As you move from one
digit to the next. follow 1 red (dashed)
edge. 3.If you end up back at the circle
node. your number is divisible by 7. 3073
17.93 d . . u“'b v v V ' Q) "3..
“‘3553'55
v " Vﬁ"
*‘ ﬁx.» The Bunny
CS: Graphics Discovery:
Ifwe can act! some Manges.
when; should we put them? IOW:
Roﬂno mo mosh In ammo!
high curvature. r HARD? . v“ .
4 f. nv‘E.
‘ 'A‘AV.V§‘ Final Exam Scheduler
CS: Conﬂict Graph Discovety: What's the mm olﬂnal
periods we can have «we
want to avocd comm? IOW:
Findthe butﬂdlabols we modtoookxthovonlmd
momphsonommm m an the same oolov
(Vane): Who) EASY or HARD? ®®®
eae % a @ee®%@@%%®@©®@
WVWWWWWWAWWQWWWWGWWWVWGWWWWWWW
®®©%% $30 mg? ammmmm
®W®W :Wg WWWW WWW
6mm W Wm.wWa. %®w@. o . w... .u........ e e
®WWWWWW WW W WWWW WWW
e QWWWWWWWW WWWWWWQWWSQQWQMWWW
eomaewfoe ©®®®©®®®® e How do we get from here to there? Need: I. POM/nan 'v/(X4d/1ZI/(2/1l/
2. ét(gp/r 1.07/9/ Pmpnz‘a’f [on
3. 7;‘(zs’er5a/ q. fZ/Bnrf'f/IMS. Incident edges(6) Graph Vocabulary: (/1  Degree(6)
Adjacent vertloes(6)
O o 0 O
o 0
0 ° Paws»
6. 6, 6. CycHG.) SimpIe graph(G) Graph Vocabulary: Subgmmg) 6‘  a", a, / A L’____.'/,£__._.(,and
(’ " k é" imp/0'85
n/I  n amp" and v a".
Complete subgraph(G,) 
O O O 0 Connected oomponent(G) 
0
0 o
O
Acywc summpmez) —
6. Spanning tree(G1)  Graphs: theory that will help us in analysis (arm/’3 time5 often reported in terms of n, the numéer of
Valtires, (Sat (Ivy 0/2?» depend on m, the "under of c.4325. How many edges? At least:
0 [iv/1' I I) connected — All]  M
notoonnected Almost simple  not simple  Reletlonshlp to degree sum: Edegﬂr) =
sEV ...
View
Full
Document
 Spring '09
 Heeren

Click to edit the document details