This preview shows page 1. Sign up to view the full content.
Unformatted text preview: might be two kinds of edges: i.e., it might be useful to label the edges. As usual, feel free to ignore this hint and come up with an algorithm from scratch.) 3. (15 points ) Exercise 8 in Chapter 3. 4. ( Do NOT turn this problem in ) Given a directed graph G = ( V,E ), a vertex s V is called a sink if there are incoming edges from every other vertex to s but no outgoing edge from s , i.e. { ( u,s ) E } =  V  1 and { ( s,u ) E } = 0. As a warmup present an O ( n 2 ) algorithm to nd out if G has a sink and if so, to output it. (Recall that n =  V  ). Now present an O ( n ) time algorithm for the same problem. 1...
View
Full
Document
This note was uploaded on 12/11/2011 for the course CSE 331 taught by Professor Rudra during the Fall '11 term at SUNY Buffalo.
 Fall '11
 RUDRA

Click to edit the document details