Differentiate an algorithm, a flowchart and pseudocode.
5 marks
Answer in brief
An algorithm is the step-by-step solution to a problem. A flowchart and pseudocode are two ways of presenting that solution.
Algorithm
An algorithm is usually written as numbered steps. It states what input is needed, what actions must be performed and what result must be produced. It is useful for explaining a short solution in ordinary language.
Flowchart
A flowchart presents the steps as a diagram. Rectangles show processing, diamonds show decisions and arrows show the direction of execution. It is useful when we need to see different choices or repeated paths. Large charts can be difficult to draw and change.
Pseudocode
Pseudocode uses structured text such as READ, IF, WHILE and OUTPUT. It is useful for writing longer logic before choosing the exact C syntax. It is generally easier to edit than a large diagram.
Example: sum of two numbers
The algorithm says: read two numbers, add them and display the sum. Pseudocode writes the same actions using named variables. The flowchart uses Start, input, process, output and End symbols. All three must describe the same calculation.
READ a, b
sum ← a + b
OUTPUT sum
Important difference
The solution itself does not change when its presentation changes. For example, a condition must not become its opposite when it is copied from pseudocode to a flowchart. Check that the starting values, conditions and output agree in every version. None of these ordinary descriptions is automatically an executable C program.
Reference table
↔ Scroll horizontally on a small screen
Three ways to discuss a solution
Aspect
Algorithm as numbered steps
Flowchart
Pseudocode
Form
A sequence of precisely written steps
Connected graphical symbols
Indented, structured text
Strength
Easy to introduce in ordinary language
Makes branches and loops visible
Scales well to detailed structured logic
Editing
Simple for short descriptions
Layout may need rearranging
Usually easy to revise
Execution
Not directly executable
Not directly executable
Not directly executable
Correctness
Depends on the logic
Depends on the same logic
Depends on the same logic
Key points
The algorithm is the logic, rather than a particular drawing format.
Different representations must agree on decisions and results.
Related exam questions
Topic matches from the supplied JNTUH papers. Marks below are the printed allocations for those questions.
January/February 2024 · Q2(b) · 5 marks
Discuss the importance of flowcharts and pseudocode in designing algorithms.