CS300-01_Algorithm_Analysis - Algorithm Analysis + Sung...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
22 Outline 1. Introduction 2. Analyzing Algorithms and Problems 3. Measuring Complexities
Background image of page 2
33 1. Introduction Definition : ( Algorithm ) An algorithm is a finite sequence of instructions, if followed, to accomplish a particular task Five properties : Input : Zero or more quantities (data) are supplied externally Output : At least one quantity (data) is produced Definiteness : Each instruction must be clear and unambiguous Finiteness : An algorithm is required to terminate after a finite number of steps Effectiveness : Every instruction must be sufficiently basic so that anyone can follow In- put Out- put
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
The characterization of a solution of a problem S is a solution of problem A if and only if S satisfies property C C is said to be the characterization of a solution. 44 Good algorithm Good characterization Why ? (What dose it mean by “good” ?) Is its converse true ? Well, . ..... Seemingly not but nobody knows !!! S is a solu- tion S satisfies C
Background image of page 4
55 Algorithm description languages pidgin ALGOL FORGOL Java Unambiguous Independent of computers Easy to translate into a computer language
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
66 2. Analyzing Algorithms and Problems Correctness Efficiency Amount of work done (time complexities) Amount of space used (space complexities) Optimality Simplicity (clarity)
Background image of page 6
Replacement Lectures Sun Mon Tues Wed Thur Fri Sat 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Monday 7 - 8:00 PM Tuesday 7 - 8:00 PM ? 77
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
88 Correctness Precise problem statement: What inputs to work on What results to produce Solution method Implementation A sequence of instructions for carrying it out In- put Out- put
Background image of page 8
How to Prove Correctness Loop invariants Program structure Definition: (Loop invariant) Loop invariants are conditions and relationships that are satisfied by the variables and data structures at the end(beginning) of each iteration of the loop. Proving loop invariants by mathematical induction !! Loop
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/07/2010 for the course CS 300 taught by Professor Shin during the Spring '10 term at Korea Advanced Institute of Science and Technology.

Page1 / 29

CS300-01_Algorithm_Analysis - Algorithm Analysis + Sung...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online