Lecture 7 Paradigm #5 Greedy Algorithms
Ref. CLRS, Chap. 16
Example 1 (Making change) Suppose you buy
something of cost less than $5, and you get your
change in Canadian coins. How can you
minimize
Lecture 6 More Divide-Conquer
and Paradigm #4 Data Structure.
Today, we do more divide-and-conquer.
And, we do Algorithm design paradigm # 4:
invent or augment a data structure.
More divide and conq
Lecture 11 Deterministic Selection
The goal is to determine the i'th smallest element from a list of n
elements in linear time. No random numbers are used.
The algorithm is due to Blum, Floyd, Pratt
Lecture 10. Paradigm #8:
Randomized Algorithms
Back to the majority problem (finding the
majority element in an array A).
FIND-MAJORITY(A, n)
while (true) do
randomly choose 1 I n;
if A[i] is the ma
Lecture 2
We have given O(n3), O(n2), O(nlogn) algorithms for the max sub-range problem. This
time, a linear time algorithm!
The idea is as follows: suppose we have found the maximum subrange sum for
CS341, Winter, 2011
Algorithms
Instructor: Ming Li
David R. Cheriton School of Computer Science
University of Waterloo
http:/www.cs.uwaterloo.ca/~cs341/
The last century has witnessed the
development
CS341, Winter, 2011
Algorithms
Instructor: Ming Li
David R. Cheriton School of Computer Science
University of Waterloo
http:/www.cs.uwaterloo.ca/~cs341/
The last century has witnessed the
development