Representation of Algorithms

It may also be noted from the given examples that to solve a given problem, every instruction must be strictly carried out in a particular sequence. It is this fact, which a beginner to problem solving by computers finds difficult to appreciate. Representation of Algorithms There are various ways in which an algorithm can be represented. Programmers normally use one or more of the following ways to represent their algorithms: I. As programs 2, As flowcharts 3. As pseudocodes

When an algorithm is represented in the form of a programming language, it becomes a program. Hence, any program is an algorithm, although the reverse is not true. Besides represented as programs, algorithms are often represented as flowcharts and pseudocodes. These are the commo’1ly IIsed tools used by programmers for program planning, which can often be of immense help in developing an effective and correct algorithm for a program, before it is coded into a programming language. Flowchart A flowchart is a pictorial representation of an algorithm.

It is often used by programmers as a program-planning tool for organizing a sequence of steps necessary to solve a problem by a computer. It uses boxes of different shapes to denote different types of instructions. The actual instructions are written within these boxes using clear and concise statements. These boxes are connected by solid lines having arrow marks to indicate the flow of operation, that is, the exact sequence in which the instructions are to be executed. The process of drawing a flowchart for an algorithm is often referred to as flowcharting.