02-background-review.ppt

# 02-background-review - CS4102 Algorithms Spring 2010 • Properties of algorithms • Counting basic operations • Time and space complexity •

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

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

View Full Document

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

View Full Document

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

View Full Document

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.

Unformatted text preview: 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 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. 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? 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. • Strategy: • Compare target to each entry in turn until a match is found or the array is exhausted....
View Full Document

## This note was uploaded on 03/21/2010 for the course CS 445 taught by Professor Bloomfield,a during the Spring '08 term at UVA.

### Page1 / 29

02-background-review - CS4102 Algorithms Spring 2010 • Properties of algorithms • Counting basic operations • Time and space complexity •

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

View Full Document
Ask a homework question - tutors are online