{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CS300-01_Algorithm_Analysis

# CS300-01_Algorithm_Analysis - Algorithm Analysis Sung Yong...

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

@ , §+ 11 Algorithm Analysis Sung Yong Shin CS Dept. KAIST

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

View Full Document
22 Outline 1. Introduction 2. Analyzing Algorithms and Problems 3. Measuring Complexities
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

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

View Full Document
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
55 Algorithm description languages pidgin ALGOL FORGOL Java Unambiguous Independent of computers Easy to translate into a computer language

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

View Full Document
66 2. Analyzing Algorithms and Problems Correctness Efficiency Amount of work done (time complexities) Amount of space used (space complexities) Optimality Simplicity (clarity)
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

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

View Full Document
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
99 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.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}