0% found this document useful (0 votes)
11 views5 pages

UNIT I - Session 1

Uploaded by

sakuyuki.owo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views5 pages

UNIT I - Session 1

Uploaded by

sakuyuki.owo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 5

UNIT I

INTRODUCTION TO ALGORITHM
DESIGN
Algorithms
⚫ A finite set of instructions or logic, written in order, to
accomplish a certain predefined task.

⚫ Algorithm is not the complete code or program.

⚫ It is just the core logic (solution) of a problem.

⚫ Can be expressed either as an informal high level


description as pseudo code or using a flowchart.
Characteristics of an Algorithm
⚫ Input
An algorithm should have 0 or more well defined inputs.
⚫ Output
An algorithm should have 1 or more well defined outputs
⚫ Unambiguous
Algorithm should be clear and unambiguous.
⚫ Finiteness
Algorithms must terminate after a finite no. of steps.
⚫ Feasibility
Should be feasible with the available resources.
⚫ Independent
An algorithm should have step-by-step directions which should be
independent of any programming code.
Pseudo code
⚫ It is one of the methods that could be used to represent an
algorithm.

⚫ It is not written in a specific syntax

⚫ Cannot be executed

⚫ Can be read and understood by programmers who are familiar with


different programming languages.

⚫ Transformation from pseudo code to the corresponding program


code easier.

⚫ Pseudo code allows to include control structures such as WHILE,


IF-THEN-ELSE, REPEAT-UNTIL, FOR, and CASE, which are
available in many high level languages.
Difference between Algorithm and
Pseudocode
Algorithm Pseudo code
A finite set of instructions or logic, a generic way of describing an algorithm
written in order, to accomplish a without using any specific programming
certain predefined task. language-related notations.
It is just the core logic (solution) of It is an outline of a program, written in a
a problem form which can easily be converted into real
programming statements.
Easy to understand the logic of a Can be read and understood by
problem programmers who are familiar with different
programming languages.

Can be expressed either as an It is not written in a specific syntax. It allows


informal high level description as to include control structures such as
pseudo code or using a flowchart. WHILE, IF-THEN-ELSE, REPEAT-UNTIL,
FOR, and CASE, which are present in
many high level languages.

You might also like