{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

02-background-review

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

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

View Full Document Right Arrow Icon
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
Background image of page 1

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

View Full Document Right Arrow Icon
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
Background image of page 2
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.
Background image of page 3

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

View Full Document Right Arrow Icon
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
Background image of page 4
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?
Background image of page 5

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

View Full Document Right Arrow Icon
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?
Background image of page 6
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.
Background image of page 7

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

View Full Document Right Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}