{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

assignment1 - CSIS 0250B Design and Analysis of Algorithms...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CSIS 0250B Design and Analysis of Algorithms Assignment 1 Due: 10:30 AM, Feb 11, 2009 Warm-up (no need to turn in) 1. Show how you would modify depth first search to report a cycle of a given undirected graph, if it exists. The running time of your algorithm should be O ( m + n ) for a graph with n nodes and m edges. 2. The following algorithm attempts to detect whether an undirected graph contains a cycle: Sum the number of entries in the adjacent lists of all vertices. If the sum is at least twice the number of vertices, report that the graphs contains a cycle. Is this algorithm correct? 3. You are given an array of n elements. Some of the elements are duplicates. Given an O ( n log n ) time algorithm to remove all duplicates from the array. 4. Claim: Let G be a graph on n nodes, where n is an even number. If every node of G has degree at least n/2, then G is connected. Is the claim true or false? Problems
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Ask a homework question - tutors are online