SHEN'S CLASS NOTES
Chapter 4 Non-Comparison Sorting
As we can observe that all comparison sorting algorithms discussed in Chapter 3 have a worst case running time (nlgn) or larger. Can we do better? The answer is no if the sorting is based on compar
SHEN'S CLASS NOTES
Chapter 15 Dynamic Programming
Dynamic Programming is one of commonly used general approach to solving an optimization problem. The basic strategy of dynamic programming is to solve the problem with small sizes first, and then use
SHEN'S CLASS NOTES
Chapter 16 Greedy Algorithms
Like the dynamic programming, greedy algorithms are used to solve optimization problems also. Examples of optimization problems: (1) Find the largest number among n numbers. (2) Find the minimum spanni
SHEN'S CLASS NOTES
Chapter 22 Elementary Graph Algorithms
22.1 Representation of Graphs There are two commonly used methods. (1) Adjacency list (2) Adjacency matrix Example 1
1 2 3 5 4 (a) A graph G
1 1 2 3 4 5 2 3 4 5
For undirected graph
1 2 3 4
SHEN'S CLASS NOTES
Chapter 23 Minimum Spanning Trees
Definition 1 Given a connected (undirected) graph G(V, E), a spanning tree T of G is a subgraph of G that is a tree and contains all vertices in V. Definition 2 Given a connected (undirected) and
SHEN'S CLASS NOTES
Chapter 22 Elementary Graph Algorithms
22.1 Representation of Graphs There are two commonly used methods. (1) Adjacency list (2) Adjacency matrix Example 1 For undirected graph
1
2 3
5
4 (a) A graph G
1 1 2 3 4 5 2
1 2 3 4 5
SHEN'S CLASS NOTES
Chapter 23 Minimum Spanning Trees
Definition 1 Given a connected (undirected) graph G(V, E), a spanning tree T of G is a subgraph of G that is a tree and contains all vertices in V. Definition 2 Given a connected (undirected) and
SHENS CLASS NOTES
Chapter 34 NP-Completeness
34.1 Basic Concepts After long time study, people found that some problems can be efficiently solved, and some problems are so difficult that only exponential time algorithms are known for them or even no
SHEN'S CLASS NOTES
Chapter 24 Single Source Shortest Paths
As we have defined earlier, given a weighted graph G(V, E), directed or undirected, the weight of a path p = <v0, v1, v2, ., vk > is the sum of all edge weights on the path:
k
w(p) =
i 1
w
SHEN’s CLASS NOTES-F06
Chapter 1 Introduction
1.1Algorithms and problems
An algorithm
is a well-defined computational procedure to solve a
computational problem (or problem for short).
An algorithm must be correct. A good algorithm must
be readable, time-
SHEN'S CLASS NOTES-F06
Chapter 3 Comparison Sorting
A sequence of n numbers, a1, a2, a3, ., an is said to be in increasing (or, non-decreasing) order if a1 a2 a3 . an. Sorting a given sequence of n numbers is to rearrange them into increasing order.
SHEN'S CLASS NOTES
Chapter 16 Greedy Algorithms
Like the dynamic programming, greedy algorithms are used to solve optimization problems also. Examples of optimization problems: (1) Find the largest number among n numbers. (2) Find the minimum spanni
SHEN'S CLASS NOTES
Chapter 9 Medians and Order Statistics
Suppose a1 < a2 < a3 < . < an are n numbers. a1 is called the first order statistics (or, the minimum number). a2 is called the second order statistics (the 2nd smallest number). . ai is call
SHEN'S CLASS NOTES
Chapter 15 Dynamic Programming
Dynamic Programming is one of commonly used general approach to solving an optimization problem. The basic strategy of dynamic programming is to solve the problem with small sizes first, and then use
SHEN'S CLASS NOTES
Chapter 9 Medians and Order Statistics
Suppose a1 < a2 < a3 < . < an are n numbers. a1 is called the first order statistics (or, the minimum number). a2 is called the second order statistics (the 2nd smallest number). . ai is call
SHEN'S CLASS NOTES
Chapter 34 NP-Completeness
34.1 Basic Concepts After long time study, people found that some problems can be efficiently solved, and some problems are so difficult that only exponential time algorithms are known for them or even n
SHEN'S CLASS NOTES
Chapter 24 Single Source Shortest Paths
As we have defined earlier, given a weighted graph G(V, E), directed or undirected, the weight of a path p = <v0, v1, v2, ., vk > is the sum of all edge weights on the path: w(p) = w(vi-1,
W07/CS592
Homework Four Design and Analysis of Algorithms Due: Mar. 20, 2007
There are 5 problems 1 (a) Conduct a DFS for the following graph. Please label each vertex u with the discovery time and the finish time d(u)/f(u). You should start the tr
W07/CS592
Suggested Solutions to Homework Three Design and Analysis of Algorithms Due: Mar. 6, 2007
There are 5 problems 1. Find an optimal parenthesization of a matrix chain product whose sequence of dimensions is (7, 11, 4, 9, 3, 16). Page 356, E
W07/CS592
Homework One Design and Analysis of Algorithms Due: January 30, 2007
There are five problems
1 Determine and use theta ( ) notation to represent asymptotic upper and lower bounds for each T(n) of the following functions or recurrence rela
W07/CS592
Homework Five Design and Analysis of Algorithms Due: Apr. 17, Tuesday, 2007
There are 4 problems 1. Page 577, Problem 23-4 (a)(b). Alternative minimum-spanning tree algorithm In this problem, we give pseudocode for three different algorit
W07/CS592
Homework Six Design and Analysis of Algorithms Due: Apr. 26, Thursday, 2007
There are 3 problems
1 Suppose you are given a "black-box" P subroutine that decides if a given set S of n positive integers has a subset A whose total sum is t,
W08/CS5592
Homework Three
Design and Analysis of Algorithms
Due: Monday, March 10, 2008, in class
There are four problems
1
Find an optimal parenthesization of a matrix chain product whose sequence of
dimensions is (8, 10, 6, 11, 3, 35).
2
Re-consider the
W08/CS5592
Suggested Solutions to Homework Two Design and Analysis of Algorithms Due: Monday, Feb. 18, 2008, in class
There are four problems
1 The number of cars produced by Toyota company in the past n years are stored in an array A[1], A[2], .,
W08/CS5592
Homework One Design and Analysis of Algorithms Due: Monday, Feb. 4, 2008
1
2
Determine and use theta ( ) notation to represent asymptotic upper and lower bounds for each T(n) of the following functions or recurrence relations. Assume T
W08/CS5592
Homework Four Design and Analysis of Algorithms Due: Monday, March 31, 2008, in class
There are four problems
1 (a) Conduct a DFS for the following graph. Please label each vertex u with the discovery time and the finish time d(u)/f(u).
W08/CS5592
TEST ONE Design and Analysis of Algorithms
Feb. 27, 2008, Wednesday, 7:00-8:15pm
The following are three take home problems 1 Let A and B be two n n matrices. It is well known that direct computing the product C = AB needs (n3) multiplic
W07/CS592
Homework Two Design and Analysis of Algorithms Due: Feb. 13, 2007
There are four problems
1 There are n houses located on a west-east street. H[i] (meters), 1 i n, is the distance from the west-end of the street to the ith house. You may