Download presentation
Presentation is loading. Please wait.
Published bySteven Hardy Modified over 8 years ago
1
Algorithms and Algorithmic Thinking
3
Instructions on making a Jam Sandwich
5
Origins of Algorithms Dinsdag 6 augustus 2002 is de Nederlandse informaticus Edsger Wybe Dijkstra overleden. Hij werd over de hele wereld beroemd door zijn ideeën over gestructureerd programmeren.
7
“Peeling Potatoes for a Family Supper” We observe the cook doing this “He gets the potato basket from the cellar, gets the pan from the cupboard, peels the potatoes returns the basket to the cellar” Sequence
9
“Go to the other side of the road” “Go to Hell” Meaningful Instructions Effective
11
Meaningful Instructions Unambiguous A wedding journalist reported that the four bridesmaids wore the same dress.
15
Instructions “He gets the potato basket from the cellar, gets the pan from the cupboard, peels the potatoes returns the basket to the cellar” get the potato basket from the cellar, get the pan from the cupboard, peel the potatoes return the basket to the cellar Sequence Correct Order
17
Jordan does something different get the potato basket from the cellar, get the pan from the cupboard, IF clothes are light colored THEN put on an apron peel the potatoes return the basket to the cellar IF some condition THEN some action Selection
19
“peel the potatoes” Halting
21
“peel the potatoes” IF number of peeled potatoes is not sufficient THEN peel a potato
23
“peel the potatoes” WHILE the number of potatoes is insufficient DO peel a potato get the potato basket from the cellar, get the pan from the cupboard, IF clothes are light colored THEN put on an apron WHILE the number of potatoes is insufficient DO peel a potato return the basket to the cellar WHILE condition is true DO an action Iteration
25
“peel the potatoes” WHILE condition is true DO an action Instruction Blocks WHILE condition is true DO action1 action2 action3
27
Algorithms – a definition Sequence of Instructions (ordered) Instructions are Effective and Unambigous Sequence must Halt in a finite time On halting, the sequence must have a Result Instructions may be Simple Actions Selections Iterations action IF condition THEN action WHILE condition is true DO action
29
DanielBobGrantAnneCarolNathanSue Sequential Search Algorithm - Example
31
DanielBobGrantAnneCarolNathanSue Sequential Search Algorithm - Example
33
Daniel BobNathan AnneCarolGrantSue Binary Search (Tree Representation) L LL H HH
35
Password Cracker Passwords created with lower case only a…z
37
Computational Thinking
41
Pseudo-code and Code there is a list of numbers get the length of the list set the value of sum to zero while the end of the list has not been reached get the next value in the list add this to the sum display the sum int numArray[2]; int len; int index; int sum; numArray[0] = 3; numArray[1] = 4; length = numArray.length; index = 0; sum = 0; while(index <= length) { sum = sum + numArray[index]; index = index + 1; } printf(“Sum is %d”, sum);
43
get the potato basket from the cellar, get the pan from the cupboard, peel the potatoes return the basket to the cellar
45
I Have A Lovely Bunch Of Coconuts
47
x = 5 Y = 3 Temp = X X = Y Y = Temp
51
Music Algorithmic?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.