Algorithm
Credit: svg by Booyabazookaoriginal png by Wapcaplet · CC BY-SA 3.0
An algorithm is a set of step-by-step instructions for solving a problem or finishing a task. Computers use algorithms to do almost everything, from sorting a list of names to deciding which video to play next. But algorithms are not just for computers. A recipe is an algorithm. The steps you follow to tie your shoes are an algorithm too.
A good algorithm has clear steps in a clear order. Each step has to be something the worker, whether a person or a computer, can actually do. The steps also have to lead to the right answer every time. If you skip a step in a cookie recipe, the cookies come out wrong. Computers are even pickier. They follow instructions exactly, with no guessing.
Here is a simple algorithm for finding the biggest number in a list. First, look at the first number and remember it. Then look at the next number. If it is bigger, remember that one instead. Keep going until you have checked every number. The number you remember at the end is the biggest one. A computer can do this for a list of a million numbers in less than a second.
Different algorithms can solve the same problem in different ways. Some are fast, some are slow, and some use less memory than others. Computer scientists spend a lot of time looking for better ones. A faster sorting algorithm can save huge amounts of time when a website has to organize billions of pieces of data.
Algorithms shape a lot of what you see online. When you search the web, an algorithm decides which results show up first. When a video app suggests what to watch next, an algorithm picks it. When a map app finds the quickest way to school, an algorithm checks thousands of possible routes in seconds.
This power has caused real debate. Some algorithms used by social media or news sites can pull people toward extreme content because that content keeps them watching longer. Other algorithms used by banks or police have been shown to treat some groups of people unfairly. Researchers, lawmakers, and companies argue about how to fix these problems and who should be in charge of checking that algorithms are fair.
The next time a website seems to know exactly what you want, an algorithm made the choice.
Related
Last updated 2026-04-25
