This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: CSIS 0250B Design and Analysis of Algorithms Assignment 2 Due: 11:59 PM, Feb 26, 2009 Warm-up (no need to turn in) 1. Given a directed graph G in adjacency list format, show how to construct the reverse graph in linear time. 2. Give a linear-time algorithm to determine when a given DAG (directed acyclic graph) G contains a directed path that touches every vertex exactly once. 3. Dijkstra’s algorithm can be implemented in O (( m + n )log n )) time, where n and m are respec- tively the number of vertices and edges in the graph. Suppose you have been told that the input graph is a dense graph and m is close to n 2 . Could you find another way to implement Dijkstra’s algorithm in O ( n 2 ) time? 4. The following algorithm attempts to find the shortest path from node s to node t in a directed graph with some negative edges: Add a large enough number to each edge weight so that all the weights become positive, then run Dijkstra’s algorithm....
View Full Document
This note was uploaded on 03/01/2010 for the course CS 1234 taught by Professor Chan during the Spring '10 term at University of the Bío-Bío.
- Spring '10