CS/SE 2C03 - Assignment 3 Solution
Adam Lenarcic
1. Exercise 22.1-4
Make a new empty adjacency-list (size V ).
Repeat for each vertex vi cfw_1 i |V |:
For each vertex vj in vi s list, if i > j copy vj
DATA STRUCTURES & ALGORITHMS
CS/SE2C03
Introduction
What is an algorithm ?
CS/SE2C03
Introduction
What is an algorithm ?
ALGORITHM
Input Output
CS/SE2C03
Introduction
What is an algorithm ?
ALGORITHM
Dynamic Programming (DP)
Have we being doing too much work in our recursions?
CS/SE2C03
Dynamic Programming (DP)
Have we being doing too much work in our recursions?
CS/SE2C03
Dynamic Programming (DP)
Minimum Spanning Trees
Figure: A MST
CS/SE2C03
Minimum Spanning Trees
Figure: A MST
CS/SE2C03
Minimum Spanning Trees
Figure: A cut
CS/SE2C03
Kruskals algorithm
CS/SE2C03
Kruskals algorithm
CS/SE2C03
K
CS/SE 2C03 - Assignment 2 Solution
Kun Hu
1. Exercise 7.2-3
We look at the process of partitioning. If all the elements are already sorted in decreasing
order, each time the partitioning routine will
CS/SE 2C03 - Assignment 5 Solution
Filip Jeremic and Kun Hu
1. Exercise 24.2-3
Instead of modifying the DAG-SHORTEST-PATHS procedure, we will modify the structure
of the graph so that we can run DAG-S
Assignment 1
Do the following problems and exercises from the book. Note that the ordering reects
the order in which the relevant material is being covered by the course. Exercises are spread
througho
CS/SE 2C03 - Assignment 4 Solution
Adam Lenarcic and Filip Jeremic
1. Exercise 23.1-2
We need to show that though a light edge is safe, it is not necessarily the case that a safe
edge is a light edge.
CS/SE 2C03 - Assignment 1 Solution
Filip Jeremic
1. Problem 1-1
The rst thing we need to solve this question is to determine the relative length of a
microsecond. A quick search on the web determines
CS/SE 2C03 - Assignment 6 Solution
Adam Lenari
cc
1. 25.2-5
(k1)
(k1)
(k1)
The given alternative denition simply modies the association if dij
= dik
+ dkj . We remember that we are only concerned ndin
DATA STRUCTURES AND ALGORITHMS
CS/SE 2C03
Instructor
Dr. George Karakostas
ITB/218, ext 26132, Mac address: karakos
Office hours: W 2:30-4:30 pm
Course Assistance
Adam Lenarcic, Mac address: lenarcaj,