Algorithms: A Brief Introduction Notes: Section 2.1 of Rosen
Algorithms: A Brief Introduction Notes: Section 2.1 of Rosen
Algorithms: A Brief Introduction Notes: Section 2.1 of Rosen
Spring 2006
Algorithms Notes
Brief Introduction
1
”Algorithm” is a distortion of al-Khwarizmi, a Persian mathematician
Algorithms Notes
Formal Definition
Definition
Pseudo-code Notes
MAX Notes
MAX Notes
Pseudo-code
Max
I Prove it correct
I Verify that it has the properties of an algorithm.
I Have some intuition as to its cost.
That is, how many “steps” would it take for this algorithm to
complete its run? What constitutes a step? How do we measure
the complexity of the step?
These questions will be answered in the next few lectures, for now
let us just take a look at a couple more examples.
Check Bubble Sort and Insertion Sort in your textbooks, which you
have seen ad nauseum, in CSE155, CSE156, and will see again in
CSE310.
I will be glad to discuss them with any of you if you have not seen
them yet.
Example Notes
Change-Making Algorithm
Change
Why (and where) does this proof fail in our previous counter
example to the general case?
We need the following lemma: