Algorithm

Also known as: procedure, recipe

definition

A step-by-step set of instructions for solving a problem or accomplishing a specific task. All computer programs are algorithms—understanding them is understanding computing.

💡 Intuition

A recipe for solving problems—follow the steps, get the answer.

Core Idea

An algorithm must be precise, finite, and guaranteed to produce a result for valid inputs.

🔬 Example

A recipe for making a sandwich, directions to get somewhere, long division steps.

🎯 Why It Matters

All computer programs are algorithms—understanding them is understanding computing.

⚠️ Common Confusion

Algorithms must work for all valid inputs, not just specific examples.

Related Concepts

How Algorithm Connects to Other Ideas

Once you have a solid grasp of algorithm, you can move on to decomposition, sequence and iteration.

Learn More

Go Deeper

Frequently Asked Questions

What is Algorithm in CS Thinking?

A step-by-step set of instructions for solving a problem or accomplishing a specific task.

Why is Algorithm important?

All computer programs are algorithms—understanding them is understanding computing.

What do students usually get wrong about Algorithm?

Algorithms must work for all valid inputs, not just specific examples.

💻 Animated Visualization Animated

Watch the step-by-step process of making a sandwich