Professional Documents
Culture Documents
Computer Programming: What Is An Algorithm?
Computer Programming: What Is An Algorithm?
What is an algorithm?
1
Algorithm
• An Algorithm is :
• a recipe
• a set of instructions
• directions
• rules of a game
• a computer program
2
An example
3
GCD Algorithm
4
GCD Example
• Let:
• X = 148
• Y = 259
5
GCD Result
• X • Y
• 148 • 259
• 148 • 111
• 37 • 111
• 37 • 74
• 37 • 37
6
Example 2
• Let :
• X = 624392601
• Y = 564719532
• Work out answer.....
7
A Problem
8
Algorithm is the same
9
Key Point
10