Unit I
Unit I
UNIT I – Introduction
Notion of an Algorithm – Fundamentals of Algorithmic Problem Solving –
Important Problem Types –Fundamentals of the Analysis of Algorithm
Efficiency – Analysis Framework - Asymptotic Notations and their properties
– Empirical analysis - Mathematical analysis of Recursive and Non-recursive
algorithms – Visualization.
INTRODUCTION
Unit I
WHAT IS AN ALGORITHM?
2.
NOTION OF AN ALGORITHM
• . By counting the number of nodes in the tree, we can get the total
number of calls made by the Tower of Hanoi algorithm:
EMPIRICAL ANALYSIS
• Definition:
Empirical analysis of algorithm means observing behavior of an
algorithm for certain set of input. Such an analysis is based on timing the
program on several inputs and then analyzing the results obtained.
• Empirical algorithmics is the practice of using empirical methods to study
the behavior of algorithms.
• The practice combines algorithm development and experimentation,
where algorithms are not just designed, but also implemented and tested
in a variety of situations.
• In this process, an initial design of an algorithm is analyzed so that the
algorithm may be developed in a stepwise manner.
• An empirical analysis of an algorithm is one based on actual
experimentation and observation of the results.
• Sometimes a mathematical analysis is difficult for even simple
algorithms.
PLAN FOR EMPIRICAL ANALYSIS
1. Understand the experiment’s purpose.
2. Decide on the efficiency metric M to be measured and the measurement
unit (an operation count vs. a time unit).
3. Decide on characteristics of the input sample (its range, size, and so on).
4. Prepare a program implementing the algorithm (or algorithms) for the
experimentation.
5. Generate a sample of inputs.
6. Run the algorithm (or algorithms) on the sample’s inputs and record the
data observed.
7. Analyze the data obtained.
ALGORITHM VISUALISATION
In addition to the mathematical and empirical analyses of
algorithms, there is yet a third way to study algorithms. It is called
algorithm visualization.
Definition:
Algorithm Visualization can be defined as the use of images to convey
some useful information about algorithms.