Final Exam
EECS 340: Algorithms & Data Structures
December 17, 2013
You have 180 minutes to answer all questions.
The exam is open book and notes.
Please read the questions carefully.
You can refe
EECS 340 Algorithms
2015 Spring Semester
Midterm
March 5, 2015
Write your name and CWRU id on your paper
The test is 75 minutes, 100 points
Open book, open notes, antennas off
1. Give a tight asymptot
Midterm Exam EECS 3:10: Algorithms & Data Structures October 1-5, 2014
You haVe 75 minutes to answer all questions.
The exam is open book and notes.
You can refer to algorithms / theorems / lemmas in
Midterm Exam
EECS 340: Algorithms & Data Structures
October 9, 2013
You have 75 minutes to answer all questions.
The exam is open book and notes.
You can refer to algorithms/theorems/lemmas in the
Midterm Exam
EECS 340: Algorithms & Data Structures
October 9, 2013
You have 75 minutes to answer all questions.
The exam is open book and notes.
You can refer to algorithms/theorems/lemmas in the
HW Assignment 5 Ex22.2-7
Ex22.3-5 Ex22.3-8
Exercise 22.2-7
We can use the graph G = (V, E) with each vertex represents a wrestler and each
edge represents a rivalry.
Thus, the graph contains n vertice
HWAssignment8Ex.16.12Ex.16.24Evaluation
Exercise16.12
Thisapproach,insteadoflookingfortheactivitythatstartsfirstinthenormal
approach,issimplyfindingtheactivitywiththelastfinishpointeverytime.Thuswe
ca
EECS 340: Algorithms
Sample Quiz
Quiz 2: Asymptotic Notation
Name:
Solution
Let f (n) = O(nk ) where k is a positive constant. Prove that f (2n) = O(nk ).
Solution:
Since f (n) = O(nk ), we know that
EECS 340: Algorithms
September 8, 2014
Quiz 1: Loop Invariants
Name:
Solution
Consider the following procedure:
procedure WhatsThat(A, n)
1 r
2 for i = 1 to n do
3
if A[i] < r then
4
r A[i]
5 return r
EECS 340: Algorithms
Fall 2014
In-Class Exercise 1: Comparing Functions
Instructor: Mehmet Koyutrk
u
For each of the following pairs of functions, write down the asymptotic relation between f (n)
and
EECS 340: Algorithms
Fall 2014
In-Class Exercise 1: Comparing Functions
Instructor: Mehmet Koyutrk
u
For each of the following pairs of functions, write down the asymptotic relation between f (n)
and
Course Syllabus
Fall 2014
EECS 340: Algorithms
Instructor: Mehmet Koyut rk
u
1
Course Objectives
Computer Science is no more about computers than astronomy is about telescopes.
E. W. Dijkstra
This co
EECS 340: Algorithms
Example
Quiz 5: Optimal Substructure
Name:
The rod cutting problem is dened as follows: We are given a rod of length n (where n is an integer)
and and array p[1.n] of prices such
EECS 340: Algorithms
Example
Quiz 5: Optimal Substructure
Name:
Solution
The rod cutting problem is dened as follows: We are given a rod of length n (where n is an integer)
and and array p[1.n] of pri
EECS 340: Algorithms
Fall 2015
In-Class Exercise 1: Comparing Functions
Instructor: Mehmet Koyutrk
u
For each of the following pairs of functions, write down the asymptotic relation between f (n)
and
Course Syllabus
Fall 2015
EECS 340: Algorithms
Instructor: Mehmet Koyut rk
u
1
Course Objectives
Computer Science is no more about computers than astronomy is about telescopes.
E. W. Dijkstra
This co
EECS 340: Algorithms
September 2, 2015
Quiz 1(Solution): Loop Invariants
Name:
Consider the following procedure:
procedure WhatDoesItDo(A, n, v)
1 c0
2 for i 1 to n do
3
if A[i] = v then
4
cc+1
5 retu
EECS 340: Algorithms
Fall 2015
In-Class Exercise 1: Comparing Functions
Instructor: Mehmet Koyutrk
u
For each of the following pairs of functions, write down the asymptotic relation between f (n)
and
EECS 340: Algorithms
Example Solution
Quiz 1: Loop Invariants
Name:
Solution
Consider the following procedure:
procedure NotSoEfficient(c)
1 xc
2 yc
3 while x > 0 do
4
y y+1
5
xx1
6 return y
(a) State
September 16, 2015
EECS 340: Algorithms
Quiz 2: Asymptotic Notation
Name:
Solution
Prove or disprove that O(n) + O( n) = O(n).
Solution:
The statement is true, as we prove below:
Consider any two posi
EECS 340: Algorithms
Fall 2015
Quiz 2(Example): Substitution Method
Name:
Solution
Let T (n) = T (n/2) + 3T (n/8) + (n). Prove that T (n) = O(n).
Solution
Since T (n) = T (n/2) + 3T (n/8) + (n), we kn
December 3, 2014
EECS 340: Algorithms
Quiz 6: Greedy Choice
Name:
Solution
We have n activities. Each activity requires ti time to complete and has deadline di . We would
like to schedule the activiti
EECS 340: Algorithms
October 1, 2014
Quiz 3: Substitution Method
Name:
Solution
Let T (n) = T (n/2) + 3T (n/8) + (n). Prove that T (n) = O(n).
Solution:
Since T (n) = T (n/2) + 3T (n/8) + (n), we know
EECS 340: Algorithms
Sample Quiz
Quiz 2: Asymptotic Notation
Name:
Let f (n) = O(nk ) where k is a positive constant. Prove that f (2n) = O(nk ).
Proof is
Proof is
Proof is
Student
Grading Key
satisfa