💻 Computer Science · Topic 41 of 80

What Is an Algorithm?

An algorithm is a finite list of steps to solve a problem.

Interactive labFollow the idea step by step

About this topic

An algorithm is a finite, step-by-step set of instructions for solving a problem or completing a task. Good algorithms are precise (each step is clear), finite (they end), and effective (they actually solve the problem). The word comes from the mathematician al-Khwarizmi.

An algorithm can be described in plain words, pseudocode or a flowchart, and later turned into a program in any language. The same problem can have many algorithms, which differ in speed and memory use. For example, finding the largest number in a list can be done by keeping a current best and checking each item once. A recipe, a set of directions or the long division method are everyday algorithms.

Algorithms run search engines, GPS navigation, video recommendations and bank security. Computer scientists compare them by correctness and efficiency. A common misconception is that algorithms are only for computers or are always complicated; a simple routine such as sorting laundry by colour is an algorithm. Another is thinking the first working solution is the best. When designing one, define inputs and outputs, write the steps, test with examples, and look for a faster method.

Key ideas

  1. Clear, ordered and finite
  2. Pseudocode and flowcharts
  3. Efficiency matters

Quick check

Use cases: where What Is an Algorithm? helps

Computing ideas run phones, search engines, games and the wider internet.

Frequently asked questions

What is What Is an Algorithm??

An algorithm is a finite list of steps to solve a problem.

What will I learn in What Is an Algorithm??

Clear, ordered and finite. Pseudocode and flowcharts. Efficiency matters.

Is What Is an Algorithm? part of Computer Science?

Yes. It is one of 80 Computer Science topics on LearnViz HighSchoolEdu, with 3 key ideas, a live animation and a quick check.

Does the What Is an Algorithm? lab work on a phone or tablet?

Yes. The animation resizes to fit your screen and supports touch, so you can drag, tap and slide with your finger.

How should I study What Is an Algorithm??

Read the summary and key ideas first, play with the interactive lab to see the idea in motion, then answer the quick check. If you get a question wrong, go back to the key idea it tests.

Do I need an account, and is my progress saved?

No account is needed. Marking a topic as learned is saved in your own browser, so it stays on that device and is not sent to a server.

More in Computer Science