You are on page 1of 5

NAME HAIDER ALI

ROLL# 22021

CONT. +92333-4337739

BS (IT)
ASSIGNMENT ALGORITHM

AL HABIB GROUP OF
COLLEGES
PEOPLES COLONY D-GROUND FAISALABAD
Q:1
Define and analysis of algorithm?

DEFINITION…..
A computational procedure that takes some values or set of values as input and
produce some values or set of values as output is known as ALGORITHM.
Thus ALGORITHM Is a series of steps that transforms input to output.

ANALYSIS OF ALGORITHM
To analyze an algorithm is to determine the amount of resources (such as time and
storage) necessary to execute it. Most algorithms are designed to work with inputs of
arbitrary length. Usually the efficiency or running time of an algorithm is stated as a
function relating the input length to the number of steps (time complexity) or storage
locations (space complexity).

Algorithm analysis is an important part of a broader computational complexity theory,


which provides theoretical estimates for the resources needed by any algorithm which
solves a given computational problem. These estimates provide an insight into reasonable
directions of search for efficient algorithms.

THEORATICAL ANALYSIS

It is common to estimate their complexity in the asymptotic sense, i.e., to estimate the
complexity function for arbitrarily large input. Big O notation, omega notation and theta
notation are used to this end. For instance, binary search is said to run in a number of
steps proportional to the logarithm of the length of the list being searched, or in
O(log(n)), colloquially "in logarithmic time". Usually asymptotic estimates are used
because different implementations of the same algorithm may differ in efficiency.
However the efficiencies of any two "reasonable" implementations of a given algorithm
are related by a constant multiplicative factor called a hidden constant.
Q:2
ROLE OF ALGORITHM IN COM. SCI?

The construction and analysis of algorithms and data structures is a basic and very important part of
modern computer science. Its importance increases also by the rapid development of more powerful
and faster computers. All computer programs can be described as algorithms that operate on a
structured set of data, or as a concatenation of such algorithms. To construct a large program with a
reasonable time and space consumption it is essential to have efficient solutions to the problem parts.

The main areas of research studied by the algorithm group fall into five mutually interrelated
categories, namely

1)computational geometry
(2)geometric graph algorithms
(3)parallel, distributed
(4) sequential graph algorithms
(5) computational biology
(6)searching and sorting.
Computational Geometry
Efficient algorithms or approximation algorithms for Voronoi diagrams and triangulations, optimal
decompositions and motion planning. See also Geometric Graph Algorithms.

Geometric Graph Algorithms


Efficient approximation algorithms for Euclidean network problems including minimum-cost multi-
connectivity, fault tolerant spanners and ``traveling salesperson''--type problems (also in the kinetic
setting where the input objects move with different velocities in different directions

Q:3
DIVIDE AND CONQUER APPROACH?

The asymptotic behavior of divide-and-conquer sequences is fundamental in algorithmic


since the efficiency of an algorithm is usually given by its behavior on data of large size.
One can distinguish two approaches : an elementary approach and a sophisticated
approach.

Elementary approach. Let us start with the elementary approach. It is employed in


almost all the works on the subject. It is impossible to treat all the cases and it seems
more interesting to state clear, valid results in a well defined class of recurrences. This
framework will provide heuristics for the examples met in practice and those examples
will be treated by an ad hoc method if needed.

The sequences (Tn) which satisfy the recurrence

a>1 and f(n) is function . Their asymptotic behavior is provided by the following result.
I.
If then for all .
II.
If both sequences (fn) and (Tn) are positive and then
.
III.
If then for all .
The notation is employed to express the similarity, preferably noted in math.the relation
The conjunction of the two relations
un=O(vn) and vn=O(un).

where u and v are fixed patterns, has a rational generating series in the ordinary meaning.
This subsequence thus satisfies a linear recurrence with constant coefficients of classical
type. The sequence being evaluated at powers of 2, the comparison may be extended to
all the integers under some assumptions of monotony.

The simple result that we quoted provides the complexity of several divide-and-conquer
algorithms. The multiplication of integers by Karatsuba's method, the multiplication of
polynomials, the multiplication of matrices by Strassen's method all have cost bounded
by some sequences which satisfy

For mergesort the cost in the average case and in the worst case both satisfy a recurrence
of the form

The second point above does not apply directly, but a simple variant shows that the cost
is in both cases of order . In the search of the convex hull by the divide-and-
conquer method the most expensive part is the sorting of the points according to their x-
coordinate and the complexity is still in .
Sophisticated approach. Now let us handle the sophisticated approach. The divide-and-
conquer sequences encountered in the analysis of algorithms have a polynomial behavior
i.e. of order . It is for example the case of all 2-rational sequences; indeed such a
sequence (un) is expressed by

this formula gives immediately

if a norm on the space of dimension N is used, and this provides the announced growth
because the length of the binary expansion of n is in .

Such a behavior makes it possible to consider the Dirichlet series associated with the
sequence,

The divide-and-conquer strategy thus provides a method to obtain effecient algorithms.


Moreover it leads to a large class of recurrences..

You might also like