6.046J/18.410J Practice for Final Exam (Solutions)
Problem 1.
Name 2
Short questions
In the following questions, ll out the blank boxes. In case more than one answer is correct7
you should provide the best known correct answer.
elements in the comparisonb
Introduction to Algorithms
Massachusetts Institute of Technology
Professors Erik D. Demaine and Charles E. Leiserson
October 29, 2005
6.046J/18.410J
Handout 18
Problem Set 4 Solutions
Problem 4-1. Treaps
If we insert a set of n items into a binary search
Prof. Erik Demaine
6 890: Algorithmic Lower Bounds
Fall 2014
Problem Set
Due: Wednesday October 22nd 2014
Problem 1 A Tour of Hamiltonicity Variants
For each of the following variations on the Hamiltonian Cycle problem, either prove it is in P by
giving a
Lecture 3
Minimum Spanning Trees I
Supplemental reading in CLRS: Chapter 4; ppendix B.4, B.5; Section 16.2
3.1
Greedy
lgorithms
As we said above, a greedy algorithm is an algorithm which attempts to solve an optimization
problem in multiple stages by maki
Lecture 1
Introduction & Median Finding
Supplemental reading in CLRS: Section 9.3; Chapter 1; Sections 4.3 and 4.5
1.1
The Course
Hello, and welcome to 6.046 Design and Analysis of Algorithms. The prerequisites for this course are
1. 6.006 Introduction to
Introduction to Algorithms
Massachusetts Institute of Technology
Professors Erik D. Demaine and Charles E. Leiserson
November 18, 2005
6.046J/18.410J
Handout 24
Problem Set 6 Solutions
Problem 6-1. Electronic Billboard
You are starting a new Electronic Bi
Introduction to Algorithms
Massachusetts Institute of Technology
Professors Erik D. Demaine and Charles E. Leiserson
November 18, 2005
6.046J/18.410J
Handout 25
Problem Set 7 Solutions
Problem 7-1. Edit distance
In this problem you will write a program to
Lecture 5
Fast Fourier Transform
Supplemental reading in CLRS: Chapter 30
The algorithm in this lecture, known since the time of Gauss but popularized mainly by Cooley and
Tukey in the 1960s, is an example of the divide-and-conquer paradigm. Actually, the
2.5
2
2
1.5
1.5
y
3
2.5
y
3
1
1
0.5
0.5
0
0
a)
0.5
1
1.5
x
2
2.5
3
0
0
b)
2.5
3
0.5
1
1.5
x
2
2.5
3
y
1.5
1
1
0.5
c)
2
2
1.5
1.5
x
2.5
2
1
3
2.5
y
3
0.5
0.5
0
0
0.5
1
1.5
x
2
2.5
3
d)
0
0
Figure 1: Plots of linear regression results with di erent types of
Lecture 4
Minimum Spanning Trees II
Supplemental reading in CLRS: Chapter 23; Section 16.2; Chapters 6 and 21
4.1
Implementing Kruskals
lgorithm
In the previous lecture, we outlined Kruskals algorithm for nding an MST in a connected, weighted
undirected g
Lecture 2
Recap & Interval Scheduling
Supplemental reading in CLRS: Section 16.1; Section 4.4
2.1
Recap of Median Finding
Like M ERGE -S ORT, the median-of-medians algorithm S ELECT calls itself recursively, with the argument to each recursive call being
Handout 14: Quiz 1 Solutions
Problem 1. Asymptotic Running Times [12 points] (4 parts)
For each algorithm listed below,
give a recurrence that describes its worst-case running time, and
give its worst-case running time using -notation.
You need not just
Theory of Parallel Hardware
Massachusetts Institute of Technology
Charles Leiserson, Michael Bender, Bradley Kuszmaul
February 23, 2004
6.896
Handout 5
Solution Set 2
Due: In class on Wednesday, February 18.
Starred problems are optional.
Problem 2-1. A s
Introduction to Algorithms
Massachusetts Institute of Technology
Professors Erik D. Demaine and Charles E. Leiserson
November 4, 2005
6.046J/18.410J
Handout 21
Problem Set 5 Solutions
Problem 5-1. Skip Lists and B-trees
Intuitively, it is easier to nd an
Problem 1. Let E be an alphabet and let L1,Lg Q 2* be languages so that L1 is not
regular but Lg is regular.
(i) Assume L1 L2 is nite. Since every nite set is regular, L1 L2 is regular. Observe
that
L1 : (13, U L2) 7 L2) U (L1 L2).
lf L1 U L2 were regular
Data Modeling
Elements of Entity Relationship Diagram (ERD)
Relational Data Model
IS 431 : Lecture 5
1
Data Modeling
Data Modeling (database modeling, information
modeling) is a technique for organizing and
documenting a systems data in a model.
Entity