0% found this document useful (0 votes)
8 views

Unit1 - Notes

Uploaded by

Jyo Reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Unit1 - Notes

Uploaded by

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

(17F00402) DESIGN AND ANALYSIS OF ALGORITHMS

UNIT I

Introduction: What is an Algorithm, Algorithm specification, Performance analysis.

Divide and Conquer: General method, Binary Search, Finding the maximum and minimum,
Merge sort, Quick Sort, Selection sort, Stressen‘s matrix multiplication.

Algorithm

 An Algorithm is a finite sequence of instructions that accomplishes a particular Task.


 An algorithm terminates after executing a finite number of instructions.

Know about the difference between Algorithm and Program:

Algorithm should be design and designer must have domain knowledge.

It can be written in any Language and also Hardware and software are independent, Analyze
should be there in algorithm.

Program should be done in Implementation side and programmer should have developed this.

Hardware and software are dependent. Testing should be done to identify the program has no
errors.

Priori Analysis and Posterior Analysis

Priori Analysis Posterior Analysis

1. Algorithms 1. Program

2. Independent of 2. Dependent of
Language Language
3. Hardware 3. Hardware
Independent Independent
4.Watch time and
4. Time and Space
bytes

Every algorithm must satisfy the following criteria:

Input: zero or more quantities, which are externally supplied;

Output: at least one quantity is produced;


Definiteness: each instruction must be clear and unambiguous;

Finiteness: if we trace out the instructions of an algorithm, then for all cases the algorithm will
terminate after a finite number of steps;

Effectiveness: Every instruction must be sufficiently basic that it can in principle be carried out
by a person using only pencil and paper. It is not enough that each operation be definite, but it
must also be feasible.

Algorithms that are definite and effective are also called COMPUTATIONAL PROCEDURE.
One important example of a computational procedure is the operating system of a digital
computer.

The study of algorithms includes four distinct areas.

(i) How to devise algorithms-The act of creating an algorithm is an art which may never be
fully automated.

(ii) How to validate algorithms:- Once an algorithm is devised it is necessary to show that it
computes the correct answer for all possible legal inputs. We refer to this process as algorithm
validation. The algorithm need not as yet be expressed as a program. The purpose of the
validation is to assure us that this algorithm will work correctly independent of the issues
concerning the programming language it will eventually be written in. Once the validity of the
method has been shown, a program can be written and a second phase begins. This phase is
referred to as program proving or sometimes as program verification.

(iii) How to analyze algorithms-This field of study is called analysis of algorithms. As an


algorithm is executed, it makes use of the computer's central processing unit (CPU) to perform
operations and it uses the memory (both immediate and auxiliary) to hold the program and its
data. Analysis of algorithms refers to the process of determining how much computing time and
storage an algorithm will require.

(iv) How to test a program-Testing a program really consists of two phases: debugging and
profiling. Debugging is the process of executing programs on sample data sets to determine if
faulty results occur and, if so, to correct them. as E. Dijkstra has pointed out, "debugging can
only point to the presence of errors, but not to their absence." A proof of correctness is much
more valuable than a thousand tests, (if that proof is correct), since it guarantees that the program
will work correctly for all possible inputs. Profiling is the process of executing a correct
program on data sets and measuring the time and space it takes to compute the results. One can
see that the subject of algorithms is a very diverse and challenging one.

You might also like