Assignment #4: Due September 25
1. Exercise 16.2-4 (page 384). 2. Exercise 16.2.5 (page 384). 3. 16.2-7 (page 384) 4. The following problem is known in the literature as the knapsack problem: We are
Assignment #3: Due September 18
1. Draw the permutation network for n = 16 using subnetworks for n = 8 as boxes with 8 inputs and outputs 2. Show switch settings for the following using the algorithm
Dvvljqphqw &9=
Gxh Qryhpehu 55
41 Zklfk ri wkh dojrulwkpv ri wkh vkruwhvw sdwk fdq zh dsso| wr wkh hcfw_dpsoh
jlyhq ehorz=
4
4
B
8
-4
4
D
7
2
G
-2
4
S
6
E
6
C
F
1
H
I
5
2
Vkrz wkh ghwdlov ri hdfk dojr
Assignment #4:
Due October 21
1. Exercise 16.2-4
2. Exercise 16.2.5
3. 16.2-7
4. The following problem is known in the literature as the knapsack problem: We are given n objects each of which has a we
Assignment #6:
Due December 2 (Firm!): Please keep a copy since the graded paper
may not reach you before Exam III
1. Solve the minimum spanning tree problem on the following graph by
(i)Boruvka Algor
Assignment #5:
Due October 30
1. Exercise 15-2-1 (page 378)
2. Exercise 15-4-1 (page 396): Note that the rst string has eight characters
and the second has nine. When you show the solution, you must i
CS 4349 Hw 3
1. An inversion in an array A[1 . n] is a pair of indices i, j such that i < j and A[i] > A[ j]. The
number of inversions in an n-element array is between 0 (if the array is sorted) and n
Homework 4 CS 4349
1. Let A[1 . n] be an array/sequence. Recall from lecture that a subsequence of A is any sequence
obtained by extracting elements from A in order; the elements need not be contiguou
Lecture #2:
This section is about comparing performance of dierent algorithms for the
same problem. For the sake of concreteness, let us focus on sorting by using
comparisons. We have several algorith
Assignment #2: Due September 9
1. 4.1-2 (page 67) 2. 4.1-6 9page 67) 3. (4.2-3) (page 72) (You may replace
n 2
by
n 2
for this problem.
4. Problem 4-1 parts (a), (b), (c), (d), (f), and (h) (page
Assignment #1: Due September 2
1. Let P be a problem. The worst-case time complexity of P is O(n2 ). The worst case time complexity of P is also (n lg n). Let A be an algorithm that solves P . Which
Lecture #3:
When we study Divide and Conquer type algorithms, we often come across
recurrence relations during the analysis phase. We need to solve these to know
the complexity of these algorithms. We
Lecture #6:
0.0.1
Divide & Conquer Method (Continued More Examples):
We conclude this section with a few more examples.
Example 1 Scheduling Tournaments among n teams to complete the schedule
in (n 1)
Lecture #8:
0.0.1
Dynamic Programming:(Chapter 15)
We now take up the concept of dynamic programming again using examples.
Example 1 (Chapter 15.2) Matrix Chain Multiplication
INPUT: An Ordered set of
Lecture #10:
0.0.1
Graph Algorithms: Shortest Path (Chapter 24-25)
Problem 1 Given a directed graph G = [V, E ], and weight function w : E
R mapping edges to real valued weights. The weight of a path
Lecture #12:
0.0.1
Graph Algorithms: Maximum Flow (Chapter 26)
Given a directed graph G = (V, E ) in which each edge (u, v ) E has a capacity
c(u, v ) 0. If (u, v ) E we assume that c(u, v ) = 0. We a
Assignment #1:
Due June 2 (Please leave this in the box outside my oce)
1. Let P be a problem. The worst-case time complexity of P is O(n2 ). The
worst case time complexity of P is also (n lg n). Let
Assignment #2:
Due June 7
1. 4.1-2 (page 67)
2. 4.1-6 9page 67)
3. (4.2-3) (page 72) (You may replace
n
2
by
n
2
for this problem.
4. Problem 4-4 parts (a), (c), (g), (h), and (j) (page 85)
5. Does th
2. Suppose you are given a matrix (a 2-dimensional array) A[1.m][1.n] of numbers. An element
A[i][ j] is called good if each of its neighbors A[i1][ j], A[i+1][ j], A[i][ j1], and A[i][ j + 1] are
at