CSCI-GA.1170-001/002 Fundamental Algorithms
October 14, 2012
Solutions to Problem 1 of Homework 6 (10 points)
Name: Chang Wang
Due: Wednesday, October 17
According to Josephus account of the siege of Yodfat, he and his n comrade soldiers were
trapped in a
Fundamental Algorithms, Problem Set 1
Due Thursday, Feb 5, in Recitation
The world can be divided into those who love New York City and
those who dont. Those who love New York tend to be unusually
lively people. They have to be. Characteristically, they a
CSCI-GA.1170-001/002 Fundamental Algorithms
September 17, 2012
Solutions to Problem 1 of Homework 2 (10 points)
Name: Hongnian Li
Due: Tuesday, September 18
(a) (6 points) Suppose you have some procedure FASTMERGE that given two sorted lists of
length m e
CSCI-GA.1170-001/002 Fundamental Algorithms
September 24, 2012
Solutions to Problem 1 of Homework 3 (20 points)
Name: Haoxiang Zuo
Due: Tuesday, September 25
The sequence cfw_Fn | n 0 are dened as follows: F0 = 1, F1 = 1, F2 = 2 and, for i > 1, dene
Fi :=
CSCI-GA.1170-001/002 Fundamental Algorithms
September 3, 2014
Problem Set 1
Lecturer: Yevgeniy Dodis
Due: Tuesday, September 10
Problem 1-1 (Polynomial Evaluation)
16 (+4) points
A degree-n polynomial P (x) is a function
n
P (x) = a0 + a1 x + . . . + an1
CSCI-GA.1170-001/002 Fundamental Algorithms
October 7, 2012
Solutions to Problem 1 of Homework 5 (10 points)
Name: Chang Wang
Due: Tuesday, October 9
(a) (4 points) Suppose we want to sort an array A of n elements from the set cfw_1, 2, . . . , (log n)log
CSCI-GA.1170-001/002 Fundamental Algorithms
September 8, 2015
Problem Set 1
Lecturer: Yevgeniy Dodis
Due: Tuesday, September 15
Problem 1-1 (Insertion Sort Using a Linked List)
10 points
Consider the problem of implementing insertion sort using a doubly-l
Domain-Range Substitution Example
Daniel Dadush
September 15, 2012
We wish to solve the recurrence equation:
T (n) = 2T ( n/2 ) + n,
for all positive integers n 1. Here we assume that T (1) = 1.
We will solve the recurrence using the domain - range substi
CSCI-GA.1170-001/002 Fundamental Algorithms
September 30, 2012
Solutions to Problem 1 of Homework 4 (16 points)
Name: Chang Wang
Due: Tuesday, October 2
We give the following procedure StrangeSort to sort an array A of n distinct elements.
Divide A into
CSCI-GA.1170-001/002 Fundamental Algorithms
November 9, 2012
Solutions to Problem 1 of Homework 7 (8 (+7) Points)
Name: Chang Wang
Due: Tuesday, November 13
Imagine a unary alphabet with a single letter x. A (valid) bracketing B is a string over three
sym
CSCI-GA.1170-001/002 Fundamental Algorithms
November 4, 2014
Problem Set 7
Lecturer: Yevgeniy Dodis
Due: Wednesday, November 5
Problem 7-1 (Text Alignment)
6 points
Using dynamic programming, nd the optimum printing of the text Not all those who wander ar
CSCI-GA.1170-001/002 Fundamental Algorithms
September 14, 2015
Problem Set 2
Lecturer: Yevgeniy Dodis
Due: Tuesday, September 22
Problem 2-1 (Dierent Methods for Recurrences)
14 points
Consider the recurrence T (n) = 8T (n/4) + n with initial condition T
Introduction to Algorithms
6.046J/18.401J
LECTURE 6
Order Statistics
Randomized divide and
conquer
Analysis of expected time
Worst-case linear-time
order statistics
Analysis
Prof. Erik Demaine
September 28, 2005
Copyright 2001-5 by Erik D. Demaine and
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
Divide and Conquer
A general paradigm for algorithm design; inspired by emperors and colonizers. Three-step process: 1. Divide the problem into smaller problems. 2. Conquer by solving these problems. 3. Combine these results together. Examples: Binary Se
Fundamental Algorithms, Problem Set 2
Due Thursday, February 12 in Recitation
He who learns but does not think is lost. He who thinks but
does not learn is in great danger. Confucius
1. Illustrate the operation of PARTITION(A,1,12) on the array
A = (13, 1
Introduction to Algorithms
6.046J/18.401J
LECTURE 5
Sorting Lower Bounds
Decision trees
Linear-Time Sorting
Counting sort
Radix sort
Appendix: Punched cards
Prof. Erik Demaine
September 26, 2005
Copyright 2001-5 Erik D. Demaine and Charles E. Leiserson