Basic Algorithms Fall 2012 Problem Set 3
Due: Wednesday, Oct. 3
NOTE: All students should complete exercises 15. Students in the honors section should additionally complete exercises 68, and hand in the solutions to these problems separately on Wednesday,
CSCI-UA.0310-001/002 Basic Algorithms
October 27, 2016
Problem Set 6
Lecturer: Yevgeniy Dodis
Due: Tuesday, November 1
Problem 6-1 (Walks on Augmented Trees)
8 (+4) Points
Consider a binary search tree. For any element x, define Successor(x) to be the suc
CSCI-UA.0310-001/002 Basic Algorithms
October 6, 2016
Problem Set 5
Lecturer: Yevgeniy Dodis
Due: Tuesday, October 11
Problem 5-1 (Running Median 2)
10 points
In homework 4, we designed a data structure supporting the following operations:
Build(A[1 . .
CSCI-UA.0310-001/002 Basic Algorithms
October 13, 2016
Problem Set 6
Lecturer: Yevgeniy Dodis
Due: Tuesday, October 18
Problem 6-1 (Preorder and Postorder Tree Walks)
8 Points
Consider a binary search tree. For a node p, denote by ppre and ppost the posit
CSCI-UA.0310-001/002 Basic Algorithms
November 6, 2016
Problem Set 8
Lecturer: Yevgeniy Dodis
Due: Tuesday, November 8
Problem 8-1 (I Am a Big Fan of Rats)
6 points
Using dynamic programming, find the optimum printing of the text I am a big fan of rats, i
Basic Algorithms Fall 2012 Problem Set 9
Due: Wednesday, Dec. 12
1. Let
SetPACK = cfw_ C, k : C is a collection of nite sets, at least k of which are pairwise disjoint.
Show that SetPACK is NP-complete.
Hint: reduction from Independent Set.
2. You are giv
Basic Algorithms Fall 2012 Problem Set 9
Due: Thursday, Dec. 6
1. Colorful paths (I). You are given a directed graph G = (V, E ), and nodes s, t. Nodes are
colored red, yellow, blue, or white. Let us say a path (not necessarily simple) is colorful if it
r
Basic Algorithms Fall 2012 Problem Set 8
Due: Thursday, Nov. 29
1. Suppose that you start with an arbitrary forest of up trees, containing n nodes altogether.
These trees are not necessarily balanced at all. You then perform m nd operations, using
path co
Basic Algorithms Fall 2012 Problem Set 7
Due: Wednesday, Nov. 21
1. Exercise 16.3-3 on p. 436 of CLRS.
2. Problem 16-1 on p. 446 of CLRS.
3. Consider a k -digit decimal counter, with initial value 0. Suppose that n additions to the
counter of numbers of t
Basic Algorithms Fall 2012 Problem Set 6
Due: Thursday, Nov. 15
1. Recall the following family H of hash functions dened in class: the universe of data items is
U := Zt+1 , and the set of hash keys is K := Zt ; for k = (k1 , . . . , kt ) K, a = (a0 , a1 ,
Basic Algorithms Fall 2012 Problem Set 5
Due: Wednesday, Oct. 17
1. Consider maintaining a collection of lists of items on which the following operations can be
performed:
(i) Given two lists L1 and L2 , form their concatenation L (destroying L1 and L2 in
Basic Algorithms Fall 2012 Problem Set 4
Due: Wednesday, Oct. 10
Problems 13 assume the following. You have n coins they all look identical, and all have the
same weight except one, which is heavier than all the rest. You also have a balance scale, on whi
Basic Algorithms Fall 2012 Problem Set 2
Due: Sept. 24
1. Suppose a die is rolled repeatedly until it comes up 1 or is rolled n times, whichever comes
rst. Let X be the random variable representing the number of rolls. Calculate E[X ].
Hint: use the fact
Basic Algorithms Fall 2012 Problem Set 1
Due: Sept. 17
1. Compare the following pairs of functions, and indicate whether f = o(g ), g = o(f ), f = (g ),
or NOTA (none of the above).
f (n)
a)
b)
c)
d)
e)
f)
g)
h)
g (n)
100n + log2 n
log2 n
2n
n2 / log2 n
n
Chapter 1 Algorithm Analysis
We are interested in designing good algorithms (a step-by-step procedure for
performing some task in a finite amount of time) and good data structures (a
systematic way of organizing and accessing data).
Unlike v22.102, howeve