{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

02-background-review

02-background-review - CS4102 Algorithms Spring 2010 First...

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

CS4102, Algorithms, Spring 2010 Properties of algorithms Counting basic operations Time and space complexity Worst-case and average-case Lower Bounds and Optimality …and one slide of summations First Principles

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

View Full Document
Analyzing Algorithms and Problems We analyze algorithms with the intention of improving them, if possible, and for choosing among several available for a problem. • Correctness • Simplicity Amount of work done, and space used • Optimality
Correctness can be proved! An algorithm consists of sequences of steps (operations, instructions, statements) for transforming inputs (preconditions) to outputs (postconditions) • Proving if the preconditions are satisfied, then the postconditions will be true, when the algorithm terminates. Good news for you! This course does not emphasize proving correctness.

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

View Full Document
Simplicity Simplicity in an algorithm is a virtue. Understandability matters Especially for long-lived software Easier to understand, more difficult to break it when making changes later
We said: Analyzing Algorithms and Problems Some terms from page 51 in text about problems : Feasible, tractable problems Intractable problems The class of NP-complete problems Unsolvable problems The Halting Problem Is a problem solvable? If so, is it possible to find a reasonably efficient solution?

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

View Full Document
Levels for Talking about Problem Solving Defining the problem Describing an overall strategy Describing an algorithm : Inputs and outputs Describing the processing steps to transform input to output Analysis Correctness; Time & Space Is it an optimal algorithm? Implementation issues Verification : Is it guaranteed correct?
Example: Search in an unordered array • Problem: • Let list be an array containing n entries, list[0], …, list[n-1], in no particular order. Find an index of a specified key target , if it’s in the array; return –1 as the answer if target is not in the array.

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 ]}