COMPSCI 1MD3 Lecture Notes - Lecture 1: Washing Machine, Flowchart, Euclidean Algorithm

93 views4 pages

Document Summary

Declarative descriptions: state the properties of the result, describe what the result is, short, but cannot be followed. Imperative descriptions: states how the result is obtained by a given sequence of instructions, each step in the sequence is simple enough that it can be followed. Other examples include: traffic lights, gps directions, cookbook recipes. An algorithm specifies a sequence of instructions to be executed by a machine that, when provided with input will eventually stop and produce some output. Example: a washing machine is built to follow the algorithm of taking water in, letting water out, applying detergent, rotating the drum, and heating the water. The computation prescribed by an algorithm goes through a sequence of states, starting from an initial state and each instruction leading to a new state. The sequence of states is called the trace. An algorithm created by the greek mathematician euclid used to calculate the greatest common divisor of two integer numbers.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents