{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

csc1350 1

# csc1350 1 - Notation of an Algorithm Algorithm a finite set...

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

Notation of an Algorithm Algorithm- a finite set of rules or instructions designed to solve a particular class of problems. Every algorithm must have the following features or characteristics: 1. Zero or more inputs 2. One or more outputs 3. Finiteness i. All algorithms must halt in finite time (ie. Not be infinite) 1. Definiteness i. Each step of the algorithm must be clear and unambiguous 1. effectiveness i. Each step in the algorithm must be sufficiently basic so that it, as a principle, can be correctly executed by the entity performing the algorithm Can think of an algorithm as "a cookbook recipe Writing an algorithm -you have a key ring with a bunch of keys -there's a fortress with a locked door and you want to get in -zero or more keys will work The quest: find the key, if there is one, that will open the locks Write it out: 1. Choose a key at random from the key ring (this is then the "current key") 2. Try the current key in the lock 3. IF the lock opens, halt. (This is a condition) 4.

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

### Page1 / 2

csc1350 1 - Notation of an Algorithm Algorithm a finite set...

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

View Full Document
Ask a homework question - tutors are online