Fall 2013
CS 331 01 Design and Analysis of Algorithms
TuTh 1:00 p.m. - 2:50 p.m.
Room 3/2636
Instructor
Dr. G. S. Young
- Office
8/14
- Office Hours
Tu
W
Th
- Phone
- Email
4:50 7:00 p.m.
12:20 1:00 p.m
4:50 7:00 p.m.
Or by appointment
909-869-4413
gsyoun
CS 331 Design and Analysis of Algorithms
Project #1
(Due: 11/14/2013)
Program the following algorithms that we covered in the class:
a. Classical matrix multiplication
b. Divide-and-conquer matrix multiplication
c. Strassen's matrix multiplication
In orde
CS 331 Design and Analysis of Algorithms
Homework #3
(Due: 11/21/2013)
Note: Turn in your homework with a cover sheet including your name and last 4 digits of your
student ID # so that your grade can be correctly recorded. Write on only one side of each p
CS 331 Design and Analysis of Algorithms
Homework #2
(Due: 10/31)
Note: Turn in your homework with a cover sheet including your name and last 4 digits of your
student ID # so that your grade can be correctly recorded. Write on only one side of each page.
es
13
S
33 01
p
S l2
el
Cl
h
a
s
F
ct
e
oj
Pr
on
si
1
Outline
Handout project 2
Help with project 1
2
Project 2
Handout
Requirements
Find the kth smallest element of a list
Implement 3 different algorithms (4 actually)
1.
Straightforward, sort the list (m
CS 331 Design and Analysis of Algorithms
Project #2
(Due: 12/3/2013)
Given a list of n numbers, the Selection Problem is to find the kth smallest element
in the list. The first algorithm (Algorithm 1) is the most straightforward one, i.e. to sort
the list
CS 331
Dr. Young
Divide-and-Conquer
General idea:
Divide a problem into subprograms of
the same kind; solve subprograms using
the same approach, and combine partial
solution (if necessary).
Young
CS 331 D&A of Algo.
Topic: Divide and Conquer
1
1. Find the
CS331
Dr. Young
Introduction
1. Algorithms
2. Order
3. Analysis of Algorithm
4. Some Mathematical Background
Young
CS 331 D&A of Algo.
Topic: Introduction
1
What is an algorithm?
A simple, unambiguous, mechanical
procedure to carry out some task.
Why algo
CS331
Dr. Young
The Greedy Approach
Young
CS 331 D&A of Algo.
Greedy
1
General idea:
Given a problem with n inputs, we are required to obtain a
subset that maximizes or minimizes a given objective function
subject to some constraints.
Feasible solution an
NP-Completeness
Reference: Computers and Intractability: A
Guide to the Theory of NP-Completeness
by Garey and Johnson,
W.H. Freeman and Company, 1979.
Young
CS 331
D&A of Algo.
NP-Completeness
1
General Problems, Input Size and
Time Complexity
Time comp
Dynamic Programming
General Idea
Problem can be divided into stages with a policy decision
required at each stage. (Solution is a sequence of
decisions)
Each stage has a number of states associated with it.
The effect of the policy decision at each sta
CS 331 Design and Analysis of Algorithms
Homework #4
(Due: 12/5/2014)
(Total: 100 points)
1. (25 points)
Given A=[252], B=[220], C=[2010], and D=[105]. Compute the C(i,j)'s defined in
the class for all i < j and give the solution (i.e. the multiplication
CS 331 Design and Analysis of Algorithms
Homework #1
(Due: 10/17/2013)
Note: Turn in your homework with a cover sheet including your name and last 4 digits of your
student ID # so that your grade can be correctly recorded. Write on only one side of each p
CS 331 Design and Analysis of Algorithms
Project #2
(Due: 3/8/2016)
Given a list of n numbers, the Selection Problem is to find the k th smallest element
in the list. The first algorithm (Algorithm 1) is the most straightforward one, i.e. to sort
the list