CMPT-101 Lecture Notes - Lecture 1: The Algorithm

211 views2 pages

Document Summary

An algorithm is a step-by-step process that will result in a desired outcome. We get steps and the necessary input in order to resolve the issue by following the steps, and not necessarily understand how it is being resolved. A cooking recipe is a good example of this. In a math equation with variables, the algorithm would be the equation itself. The output would be the variable we need to find (x). Steps that are executed in a sequence or in order. The standard form for sequential tasks is 1?2?3. Another way to represent sequential tasks, or algorithms in general, is on a flow chart. Example: finding average kilometres driven in a week. Algorithm calculate total km and then average km. 3 calculate total km (end km minus start km) 4 calculate average (total km divided by 7) Steps that are only executed if a condition is true.

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