Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
50 views

Algorithms and Complexity Lect 1

The document discusses algorithms and complexity. It defines algorithms, their characteristics, and complexity. Complexity measures the time and space required by an algorithm. Factors that affect runtime are described. Applications of complexity theory to problem classification are covered.

Uploaded by

Arvin Hipolito
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

Algorithms and Complexity Lect 1

The document discusses algorithms and complexity. It defines algorithms, their characteristics, and complexity. Complexity measures the time and space required by an algorithm. Factors that affect runtime are described. Applications of complexity theory to problem classification are covered.

Uploaded by

Arvin Hipolito
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Algorithms and Complexity

Disadvantages of Algorithms

1. Algorithms is Time consuming.

2. Difficult to show Branching and Looping in Algorithms.

3. Big tasks are difficult to put in Algorithms.


Characteristics of Algorithms

1. Precision – the steps are precisely stated(defined).


2. Uniqueness – results of each step are uniquely defined and only depend
on the input and the result of the preceding steps.
3. Finiteness – the algorithm stops after a finite number of instructions are
executed.
4. Input – the algorithm receives input.
5. Output – the algorithm produces output.
6. Generality – the algorithm applies to a set of inputs.
What is Complexity?

Complexity is used to characterize something with many parts where


those parts interact with each other in multiple ways.
or
Complexity is that property of a model which makes it difficult to
formulate its overall behavior in a given language, even when given
reasonably complete information about its atomic components and their
inter-relations.
Complexity of an Algorithm

Complexity of an algorithm is a measure of the amount of time and/or


space required by an algorithm for an input of a given size (n).
What effects run time of an algorithm?

(a) computer used, the hardware platform

(b) representation of abstract data types (AD T’s)

(c) efficiency of compiler

(d) competence of implementer (programming skills)

(e) complexity of underlying algorithm

(f) size of the input


Applications of Complexity

Computational complexity theory is the study of the complexity of


problems—that is, the difficulty of solving them. Problems can be classified
by complexity class according to the time it takes for an algorithm—usually a
computer program—to solve them as a function of the problem size. Some
problems are difficult to solve, while others are easy.
For example, some difficult problems need algorithms that take an
exponential amount of time in terms of the size of the problem to solve. Take
the traveling salesman problem, it can be solved in time O(n^2 2^n) (where
n is the size of the network to visit—let's say the number of cities the
traveling salesman must visit exactly once). As the size of the network of
cities grows, the time needed to find the route grows (more than)
exponentially.
Even though a problem may be computationally solvable in principle,
in actual practice it may not be that simple. These problems might require
large amounts of time or an inordinate amount of space. Computational
complexity may be approached from many different aspects.

Computational complexity can be investigated on the basis of time,


memory or other resources used to solve the problem. Time and space
are two of the most important and popular considerations when problems
of complexity are analyzed.
Thank you
Prepared by:
Miss Marie Celia R. Aglibot
Instructor

You might also like