Download presentation
Presentation is loading. Please wait.
1
Designing Software Algorithm definition
A set of well-defined instructions for carrying out a particular task. Characteristics of a good algorithm : Predictable – you know what it is supposed to do Deterministic – it always does the same thing Not subject to chance – tells you everything you need to know to do the task
2
Designing Software Recipe analogy
Predictable … you know what the recipe makes Deterministic … if you follow directions, comes out the same every time Not subject to chance … provides you: All the ingredients Measurements Every step and the order to do them in Cook times …everything you need to do it
3
Another Algorithm Task
4
Another Algorithm Task
Design an algorithm to locate the largest number in a list of numbers.
5
Another Algorithm Task
Design an algorithm to locate the largest number in a list of numbers. Work in your team (both names on the sheet).
6
Another Algorithm Task
Design an algorithm to locate the largest number in a list of numbers. Work in your team (both names on the sheet). Be ready to share it with the class.
7
Another Algorithm Task
Design an algorithm to locate the largest number in a list of numbers. Work in your team (both names on the sheet). Be ready to share it with the class. You will turn it in at the end of class.
8
Another Algorithm Task
Design an algorithm to locate the largest number in a list of numbers. Work in your team (both names on the sheet). Be ready to share it with the class. You will turn it in at the end of class. You have 15 minutes.
9
Algorithm Task Hints…
10
Algorithm Task Hints… Pick a short, easy list of numbers to work with:
11
Algorithm Task Hints… Pick a short, easy list of numbers to work with:
2, 3, 1
12
Algorithm Task Hints… Pick a short, easy list of numbers to work with:
2, 3, 1 Do the exercise yourself…and…
13
Algorithm Task Hints… Pick a short, easy list of numbers to work with:
2, 3, 1 Do the exercise yourself…and… As you do it, try to identify the individual actions you are performing.
14
Algorithm Task Hints… Pick a short, easy list of numbers to work with:
2, 3, 1 Do the exercise yourself…and… As you do it, try to identify the individual actions you are performing. Ask: are there any decisions I’m making, any questions I’m asking?
15
Algorithm Task Hints… Pick a short, easy list of numbers to work with:
2, 3, 1 Do the exercise yourself…and… As you do it, try to identify the individual actions you are performing. Ask: are there any decisions I’m making, any questions I’m asking? Ask: are there steps that I repeat?
16
Algorithm Task Hints… Pick a short, easy list of numbers to work with:
2, 3, 1 Do the exercise yourself…and… As you do it, try to identify the individual actions you are performing. Ask: are there any decisions I’m making, any questions I’m asking? Ask: are there steps that I repeat? How do I know I don’t need to repeat any more?
17
Algorithm Task Hints… Pick a short, easy list of numbers to work with:
2, 3, 1 Do the exercise yourself…and… As you do it, try to identify the individual actions you are performing. Ask: are there any decisions I’m making, any questions I’m asking? Ask: are there steps that I repeat? How do I know I don’t need to repeat any more? Ask: how do I tell when I’m completely done?
18
Algorithm Task Hints… Pick a short, easy list of numbers to work with:
2, 3, 1 Do the exercise yourself…and… As you do it, try to identify the individual actions you are performing. Ask: are there any decisions I’m making, any questions I’m asking? Ask: are there steps that I repeat? How do I know I don’t need to repeat any more? Ask: how do I tell when I’m completely done? Try to write instructions that a 5 year old could follow…
19
Your Task… Design an algorithm to locate the largest number in a list of numbers. Work in your team (both names on the sheet). Be ready to share it with the class. You will turn it in at the end of class. You have 15 minutes.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.