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 DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CS4102, Algorithms, Spring 2010 • Properties of algorithms • Counting basic operations • Time and space complexity • Worstcase and averagecase • 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 longlived 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 NPcomplete 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[n1], 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.
 Spring '08
 BLOOMFIELD,A
 Algorithms, Computer Graphics

Click to edit the document details