What is an Algorithm?
An algorithm is a set of steps to solve a problem.
For example, here’s an algorithm to make a peanut butter and jelly sandwich:- Get a piece of bread
- Spread peanut butter on it
- Get another piece of bread
- Spread jelly on it
- Put the two pieces of bread together
- Eat it!
But is it really so simple? Where’s the bread? How do you “spread”? How do you put the two pieces of bread together?
You and I know how to do these things, but try telling a computer how to make a sandwich! When you write an algorithm for a computer, you have to be very specific, and you have to speak the computer’s language. You do this by using a programming language.
Link to Introduction to Algorithms Page
No comments:
Post a Comment