Tuesday, September 18, 2018

Introduction to Algorithms


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:
  1. Get a piece of bread
  2. Spread peanut butter on it
  3. Get another piece of bread
  4. Spread jelly on it
  5. Put the two pieces of bread together
  6. 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