Pseudocode and Flow Chart Lecture 1 (1)
Pseudocode and Flow Chart Lecture 1 (1)
Characteristics of an algorithm:
2. Uniqueness – results of each step are uniquely defined and only depend on the
input and the result of the preceding steps.
3. Finiteness – the algorithm stops after a finite number of instructions are executed.
Pseudo code is a term which is often used in programming and algorithm based fields. It is
a methodology that allows the programmer to represent the implementation of an algorithm.
Simply, we can say that it’s the cooked up representation of an algorithm. Often at times,
algorithms are represented with the help of pseudo codes as they can be interpreted by
programmers no matter what their programming background or knowledge is. Pseudo code,
as the name suggests, is a false code or a representation of code which can be understood
by even a layman with some school level programming knowledge. Algorithm: It’s an
organized logical sequence of the actions or the approach towards a particular problem. A
programmer implements an algorithm to solve a problem. Algorithms are expressed using
natural verbal but somewhat technical annotations. Pseudo code: It’s simply an
implementation of an algorithm in the form of annotations and informative text written in
plain English. It has no syntax like any of the programming language and thus can’t be
compiled or interpreted by the computer.
What is the need for Pseudocode
Before writing the pseudocode of any algorithm the following points must be kept in mind.
Example:
This program will allow the user to check
the number whether it's even or odd.
• Use standard programming structures such as if-else, for, while, and cases the
way we use them in programming. Indent the statements if-else, for, while loops as
they are indented in a program, it helps to comprehend the decision control and
execution mechanism. It also improves readability to a great extent. Example:
IF “1”
print response
“I AM CASE 1”
IF “2”
print response
“I AM CASE 2”
• Use appropriate naming conventions. The human tendency follows the approach of
following what we see. If a programmer goes through a pseudo code, his approach
will be the same as per that, so the naming must be simple and distinct.
• Reserved commands or keywords must be represented in capital
letters. Example: if you are writing IF…ELSE statements then make sure IF and ELSE
be in capital letters.
• Check whether all the sections of a pseudo code are complete, finite, and clear to
understand and comprehend. Also, explain everything that is going to happen in the
actual code.
A Pseudocode is a step-by-step
An Algorithm is used to provide a
description of an algorithm in code-
solution to a particular problem in form
like structure using plain English
of a well-defined step-based form.
text.
There are no rules to writing There are certain rules for writing
algorithms pseudocode
Flowchart Pseudocode
A Pseudocode is a step-by-step
A Flowchart is pictorial representation of
description of an algorithm in code like
flow of an algorithm.
structure using plain English text.
This is a way of visually representing data, These are fake codes as the word
these are nothing but the graphical pseudo means fake, using code like
representation of the algorithm for a better structure but plain English text instead
understanding of the code of programming language