An algorithm is a finite sequence of well-defined and unambiguous steps used to solve a problem or perform a task. It takes input, processes it step-by-step, and produces the required output.
An algorithm is a finite sequence of well-defined and unambiguous steps used to solve a problem or perform a task. It takes input, processes it step-by-step, and produces the required output.
A recipe for making tea is similar to an algorithm. It gives instructions in a particular order, such as boiling water, adding tea leaves, adding milk and sugar, and finally serving the tea.
Before writing a program, a programmer can first design an algorithm to describe the solution logically. The algorithm can then be converted into a program using a programming language such as C.
An algorithm is simply a step-by-step plan for solving a problem. First we decide the logic, and then we write the program.
| Algorithm | Program |
|---|---|
| A logical step-by-step solution. | The solution written using a programming language. |
| Language independent. | Written in a specific programming language. |
| Focuses on logic. | Focuses on implementing the logic. |
| Point | Remember |
|---|---|
| Meaning | Step-by-step procedure to solve a problem. |
| Nature | Logical and language independent. |
| Input | Data required to solve the problem. |
| Output | Required result of the problem. |
| Representation | Natural language, pseudocode or flowchart. |
Watch a simple Hindi explanation of algorithms and basic problem solving.
A short handwritten-style revision sheet for Algorithm Definition will be provided here.
Use the mind map for quick revision of algorithm, input, processing and output.