You are on page 1of 6

Concepts & Applications of IT

IT - 426
Module-V

04/15/2020
An algorithm is any we-defined computational
procedure that takes some value, or set of values, as
input and produces some value, or set of values, as

Algorithm
output

An algorithm is thus a sequence of computational


steps that transform the input into the output
Concept

04/15/2020
Design and
Analysis
An algorithmic solution to a computational problem will usually involve designing an algorithm, and
then analyzing its performance

In designing and ●
What is the problem we have to solve?
analyzing an ●
Does a solution exist?

Can we find a solution (algorithm), and is there more than one
algorithm we should solution?
consider the ●
Is the algorithm correct?
How efficient is the algorithm?
following questions:

Pseudo-code
Pseudo-code provides a way of expressing algorithms in a way that is independent of any programming language. It abstracts
away other program details such as the type system and declaring variables and arrays. Some points to note are:


The statement blocks are determined by indentation, rather than { and } delimiters.

Control statements, such as if... then...else and while.

The character ✄ is used to indicate a comment line.

A statement v ← e implies that expression e should be evaluated and the resulting value assigned to variable v. Or, in the case of v1 ← v2 ← e, to variables v1 and v2.

All variables should be treated as local to their procedures.

Arrays indexation is denoted by A[i] and arrays are assumed to be indexed from 1 to N (rather than 0 to N – 1.
An example.

The algorithm would look something like this:

Step 1: Let Step 2: For each Step 3: If the Step 4: Then Step 5: Return
Largest = L1 item in the list: item > Largest: Largest = the item Largest
This means you will go
This produces the
If you find a new largest number, This replaces the old largest number with
This means you start by the new largest number you just found.
move to step four. If not, go back to
assuming that the first through the list of Once this is completed, return to step two 04/15/2020
desired result.
step two, which means you move on until there are no more numbers left in the
number is the largest number. numbers one by one. to the next number in the list. list.
Social Implications of IT

04/15/2020

You might also like