Feb 23, Algorithms – Part 1

Feb 23, Algorithms – Part 1 -...

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

View Full Document Right Arrow Icon
Algorithms – Part 1 23/02/2008 12:47:00 Definition An algorithm is a finite sequence of step by step, discrete, unambiguous  instructions for a particular problem o Given an appropriate set of input data (given information), o Where each instruction can be carried out by the computing agent  (usually a human) in a finite amount of time in a deterministic way An algorithm is a series of instructions to solve a problem (complete a task) Problems can be in any form o Business Get a part from Vancouver to Ottawa by morning Allocate manpower to max profits o Life I am hungry.  How do I order pizza? Explain how to tie shoelaces to a five year old child The problems that we will be addressing are those which involve processing  of data The algorithms that we develop to solve these problems will eventually be  translated to programs that can be run on a computer Since we can only input, store, process and output data on a computer, the  instructions in our algorithms will be limited to these functions Algorithm Representation of Computer Functions Input o Get info Get (input command) Storage
Background image of page 1

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

View Full DocumentRight Arrow Icon
o Store information Given/Result Intermediates/Set Process o Arithmetic Let (assignment command) o Repeat instructions Loop o Branch conditionals If Output o Give info Give (output command) Algorithm Description When we have a problem to solve, to ensure that we understand the problem  before we try to solve it, we prepare the Algorithm Description.  We: o Identify and name each of the data items that are available for use in  solving the problem (Input/ Givens ) o Identify and name each of the data items that we need to solve the  problem (Output/ Results ) o Assign a name to our algorithm ( Name ) o Combine the previous 3 pieces of information into a formal statement  ( Definition ) Results := Names (Givens) Method Once we have prepared the Algorithm Description, we need to solve the  problem. We develop a series of instructions (limited to those described previously)  that, when executed, will compute the desired  Results  from the  Givens  ( Method )
Background image of page 2
Assignment Command Syntax –  Let variable = expression o On the left side of =, we put the name of a variable and on the right  ride we put a value or an expression.  Note that Givens and Results  (and Intermediates as we will see) constitute the set of variables.  Each 
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/08/2009 for the course TEFLER ADM1300 taught by Professor Koppel during the Fall '09 term at University of Ottawa.

Page1 / 13

Feb 23, Algorithms – Part 1 -...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online