Homework 1
Fundamental Algorithms, Spring 2012, Professor Ezra
Assigned: Jan. 23
Due: Jan 30, in class.
INSTRUCTIONS:
Remember that we have a no late homework policy. Special permission must be obtained
in advance if you have a valid reason.
Please read

Homework 8 Solution
Fundamental Algorithms, Spring 2012, Professor Ezra
INSTRUCTIONS:
Remember that we have a no late homework policy. Special permission must be obtained
in advance if you have a valid reason.
Please read questions carefully. When in do

CSCI-GA.1170-001/002 Fundamental Algorithms
September 9, 2012
Solutions to Problem 1 of Homework 1 (10 points)
Name: * INSERT YOUR NAME HERE *
Due: Tuesday, September 11
Let A[1, . . . , n] be an array of n distinct numbers. If i < j and A[i] > A[j ], the

Homework 4
Fundamental Algorithms, Spring 2012, Professor Ezra
Monday, Feb. 20 is Presidents Day, so class will not meet.
Assigned: Feb. 13
Due: Feb. 27
INSTRUCTIONS:
Remember that we have a no late homework policy. Special permission must be obtained
in

Homework 4 Solution
Fundamental Algorithms, Spring 2012, Professor Ezra
INSTRUCTIONS:
Remember that we have a no late homework policy. Special permission must be obtained
in advance if you have a valid reason.
Please read questions carefully. When in do

Homework 3 Solutions
Fundamental Algorithms, Spring 2012, Professor Ezra
INSTRUCTIONS:
Remember that we have a no late homework policy. Special permission must be obtained
in advance if you have a valid reason.
Please read questions carefully. When in d

Homework 5 Solution
Fundamental Algorithms, Spring 2012, Professor Ezra
INSTRUCTIONS:
Remember that we have a no late homework policy. Special permission must be obtained
in advance if you have a valid reason.
Please read questions carefully. When in do

CSCI-GA.1170-001/002 Fundamental Algorithms
October 9, 2012
Solutions to Problem 1 of Homework 6 (10 points)
Name: * INSERT YOUR NAME HERE *
Due: Wednesday, October 17
According to Josephus account of the siege of Yodfat, he and his n comrade soldiers wer

CSCI-GA.1170-001/002 Fundamental Algorithms
September 23, 2012
Solutions to Problem 1 of Homework 3 (18 points)
Name: * INSERT YOUR NAME HERE *
Due: Tuesday, September 25
The sequence cfw_Fn | n 0 are dened as follows: F0 = 1, F1 = 1, F2 = 2 and, for i >

Midterm Exam Solution
March 5, 2012, Prof. Ezra
Closed books, closed notes, no calculator, no laptops. 4 problems, 1 page.
Problem 1
1) Use the recursion tree method or induction to solve, as best you can, the following recurrence equation.
Do not state a

23 Trees
23 trees are one instance of a class of data structures called balanced
trees. These data structures provide an ecient worst case instantiation
for the Dictionary abstract data type. Recall that a dictionary supports
the operations Search, Insert

Fundamental Algorithms
Sample Final Exam
Summer 2011
In any of the problems below, you may need not explain any of the standard algorithms or data
structures discussed in class. For example, if you wish to use a 2-3 tree for some problem, you may
simply s

Fundamental Algorithm: Final Exam: Solutions
Problem 1: 5 points
Put the following functions in increasing order of order-of-magnitude growth. If two functions have
the same order of magnitude growth, indicate that.
n2 ; n log n; n log2 n; n2 log n; n(n +

CSCI-GA.1170-001/002 Fundamental Algorithms
September 11, 2012
Solutions to Problem 1 of Homework 2 (10 points)
Name: * INSERT YOUR NAME HERE *
Due: Tuesday, September 18
(a) (6 points) Suppose you have some procedure FASTMERGE that given two sorted lists

CSCI-GA.1170-001/002 Fundamental Algorithms
September 26, 2012
Solutions to Problem 1 of Homework 4 (16 points)
Name: * INSERT YOUR NAME HERE *
Due: Tuesday, October 2
We give the following procedure StrangeSort to sort an array A of n distinct elements.

CSCI-GA.1170-001/002 Fundamental Algorithms
October 2, 2012
Solutions to Problem 1 of Homework 5 (10 points)
Name: * INSERT YOUR NAME HERE *
Due: Tuesday, October 9
(a) (4 points) Suppose we want to sort an array A of n elements from the set cfw_1, 2, . .

Final Exam Sample
Expected number of questions is 7, this sample contains 9.
Problem 1
Use the recursion tree method or indcution to solve, as best you can, the following recurrence equation.
1a)
T (1) = O(1)
T (n) = n + 3T ( n ), n > 1 and a power of 2.

Midterm Exam Sample
Expected number of questions is 4, this sample contains ve.
Problem 1
1) Use the recursion tree method or indcution to solve, as best you can, the following recurrence equation. 1a)
T (1) = O(1)
T (n) = n + 3T ( n ), n > 1 and a power

Homework 1
Fundamental Algorithms, Spring 2012, Professor Ezra
Assigned: Jan. 23
Due: Jan 30, in class.
INSTRUCTIONS:
Remember that we have a no late homework policy. Special permission must be obtained
in advance if you have a valid reason.
Please read

Problem Set 2
Homework 1
Fundamental Algorithms, Spring 2012, Professor Ezra
Assigned: Jan. 30
Due: Feb. 6
INSTRUCTIONS:
Remember that we have a no late homework policy. Special permission must be obtained
in advance if you have a valid reason.
Please r

Solution Set 2
Problem 1
Consider the following problem. You are given an array A of distinct positive integers and a target
sum M . Determine whether there is a subset S of A that adds up to M exactly.
For example, if A = [8, 11, 2, 6, 19, 3] and M = 17

Homework 3
Fundamental Algorithms, Spring 2012, Professor Ezra
Assigned: Feb. 6
Due: Feb 13, in class.
INSTRUCTIONS:
Remember that we have a no late homework policy. Special permission must be obtained
in advance if you have a valid reason.
Please read

Homework 5
Fundamental Algorithms, Spring 2012, Professor Ezra
Assigned: Feb. 27
Due: March. 5.
INSTRUCTIONS:
Remember that we have a no late homework policy. Special permission must be obtained
in advance if you have a valid reason.
Please read questio

Homework 6
Fundamental Algorithms, Spring 2012, Professor Ezra
Assigned: March 19
Due: March 26, in class.
INSTRUCTIONS:
Remember that we have a no late homework policy. Special permission must be obtained
in advance if you have a valid reason.
Please r

Homework 6 Solutions
Fundamental Algorithms, Spring 2012, Professor Ezra
INSTRUCTIONS:
Remember that we have a no late homework policy. Special permission must be obtained
in advance if you have a valid reason.
Please read questions carefully. When in d

Homework 7
Fundamental Algorithms, Spring 2012, Professor Ezra
Assigned: March 26
Due: April 2, in class.
INSTRUCTIONS:
Remember that we have a no late homework policy. Special permission must be obtained
in advance if you have a valid reason.
Please re

Homework 7 Solutions
Fundamental Algorithms, Spring 2012, Professor Ezra
Assigned: March 26
Due: April 2, in class.
INSTRUCTIONS:
Remember that we have a no late homework policy. Special permission must be obtained
in advance if you have a valid reason.