CS 1510 Midterm 2
Fall 2003
1. (20 points) We consider the problem of computing the longest common subsequence of two
sequences A = a1 , . . . , am and B = b1 , . . . , bn. Let T (i, j ) be the length
CS 1510
Parallel Algorithms Homework Problems
1. (2 Points) Consider the problem of computing the AND of n bits.
Give an algorithm that runs in time O(log n) using n processors on an EREW PRAM.
What
CS 1510
Greedy Homework Problems
1. (2 points) Consider the following problem:
INPUT: A set S = cfw_(xi , yi )|1 i n of intervals over the real line.
OUTPUT: A maximum cardinality subset S of S such t
CS 1510
Dynamic Programming Homework Problems
1. (2 points) Consider the recurrence relation T (0) = T (1) = 2 and for n > 1
n1
T (i)T (i 1)
T (n) =
i=1
We consider the problem of computing T (n) from
CS 1510
Approximiation Algorithms Problems
1. Consider the vertex cover problem, that is, given a graph G nd a minimal cardinality collection S of vertices with the property that every edge in G is in
CS 1510 Midterm 1 Fall 2007
1. (40 points) You wish to drive from point A to point B along a highway minimizing the time that you are stopped for gas. You are told beforehand the capacity C of you gas
CS 1510
Adversarial Lower Bound Arguments
1. In a simplied form of the game mastermind there is a hidden sequence H = (c1 , . . . , ck ) of k colored pegs. There are C dierent possible colors. Colors
CS 1510 Midterm 1
Fall 2008
1. (40 points) We consider the following problem:
INPUT: A collection of jobs J1 , . . . , Jn , where the ith job is a 3-tuple (ri , xi, di) of non-negative
integers.
OUTPU
CS 1510 Midterm 2
Fall 2008
1. (20 points) Consider the following two problems:
MATRIX MULTIPLICATION
INPUT: n by n matrices A and B
OUTPUT: The product AB
MATRIX SQUARING
INPUT: m by m matrix C
OUTPU
CS 1510 Midterm 1
Fall 2009
1. (40 points) We consider the following problem:
INPUT: A collection W of positive integer weights w1 , . . . , wn.
OUTPUT: A binary tree T with n leaves, where each leaf
CS 1510 Midterm 2
Fall 2009
The test is a bit long. I suggest keeping your answers short and to the point.
1. (a) (5 points) According to your instructor, what is the most important reason that multip
CS 1510 Midterm 1
Fall 2010
1. (40 points) We consider the following scheduling problem:
INPUT: A collection of jobs J1 , . . . , Jn , where the ith job is a tuple (ri , xi ) of non-negative
integers
CS 1510 Midterm 2
Fall 2010
The test is a bit long. I suggest keeping your answers short and to the point.
1. (a) (5 points) Consider the standard EREW algorithm for adding n integers that runs in tim
CS 1510 Midterm 1
Fall 2011
1. (40 points) Consider the following problem. The input is a collection A = cfw_a1 , . . . , an of n
points on the real line. The problem is to nd a minimum cardinality c
CS 1510 Midterm 1
Fall 2011
1. (40 points) Consider the following problem. The input is a collection A = cfw_a1 , . . . , an of n
points on the real line. The problem is to nd a minimum cardinality c
CS 1510
Reductions and NP-hardness Homework Problems
1. (2 points) A square matrix M is lower triangular if each entry above the main diagonal is zero, that
is, each entry Mi,j , with i < j, is equal
CS 1510 Midterm 1: Greedy Algorithms
Fall 2003
1. (40 points) Consider the following problem. The input consists of n skiers with heights
p1 , . . . , pn , and n skies with heights s1, . . . , sn . Th
CS 1510 Midterm 2
Fall 2010
The test is a bit long. I suggest keeping your answers short and to the point.
1. (a) (5 points) Consider the standard EREW algorithm for adding n integers that runs in tim
CS 1510 Midterm 1
Fall 2010
1. (40 points) We consider the following scheduling problem:
INPUT: A collection of jobs J1 , . . . , Jn , where the ith job is a tuple (ri , xi ) of non-negative
integers
CS 1510 Midterm 2
Fall 2009
The test is a bit long. I suggest keeping your answers short and to the point.
1. (a) (5 points) According to your instructor, what is the most important reason that multip
CS 1510 Midterm 1
Fall 2009
1. (40 points) We consider the following problem:
INPUT: A collection W of positive integer weights w1 , . . . , wn.
OUTPUT: A binary tree T with n leaves, where each leaf
CS 1510 Midterm 2
Fall 2008
1. (20 points) Consider the following two problems:
MATRIX MULTIPLICATION
INPUT: n by n matrices A and B
OUTPUT: The product AB
MATRIX SQUARING
INPUT: m by m matrix C
OUTPU
CS 1510 Midterm 1
Fall 2008
1. (40 points) We consider the following problem:
INPUT: A collection of jobs J1 , . . . , Jn , where the ith job is a 3-tuple (ri , xi, di) of non-negative
integers.
OUTPU
CS 1510 Midterm 2
Fall 2007
1. (20 points) Consider the following problem. The input consists of n positive integers V =
cfw_v1 , . . . , vn . Let L = n vi . The problem is to determine if there are t
CS 1510 Midterm 1
Fall 2007
1. (40 points) You wish to drive from point A to point B along a highway minimizing the time
that you are stopped for gas. You are told beforehand the capacity C of you gas
CS 1510 Midterm 2
Fall 2005
1. (a) Dene EREW. That is, what properties must a PRAM program have to be EREW.
(b) Explain how to merge two sorted lists x1 , . . ., xn and y1 , . . . , yn of integers in
CS 1510 Midterm 1
Fall 2005
Note that the only dierence in the rst two problems is the denition of total penalty.
1. The input to this problem consists of an ordered list of n words. The length of the
CS 1510 Midterm 4
Fall 2003
1. (20 points)
(a) What is the most important reason that it is standard practice to ignore multiplicative
constants when computing running times of algorithms/programs?
HI
CS 1510 Midterm 3
Fall 2003
1. (20 points) Consider the following 3Clique problem:
INPUT: A undirected graph G and an integer k.
OUTPUT: 1 if G has three vertex disjoint cliques of size k, and 0 other
CS 1510 Midterm 2
Fall 2010
1. (20 points) Consider the following two problems:
TRAVELING SALESMAN
INPUT: points (x1 , y1 ), . . . (xn , yn ) in the Euclidean plane
OUTPUT: The shortest route, startin