Effieciency-of-Algorithms
Effieciency-of-Algorithms
Algorithm
any well-defined computational procedure
that takes some value, or set of values, as
input and produces some value, or set
of values, as output.
T(n)=?
Time Complexity
-how long does it take to find a
solution?
Space Complexity
-how much memory does it need to
perform the search?
Nlog2N
-The time requirement increases more
rapidly than a linear algorithm. Such
algorithms usually divide a problem into
smaller problems that are each solved
separately.
N2
- The time requirement for a
quadratic algorithm increases rapidly with
the size of the problem. Algorithms that use
two nested loops are often quadratic. A
fairly reasonable efficiency, still in the
polynomial time range, the typical
examples for this order come from sorting
algorithms, such as the selection sort.
N3
-The time requirement for a cubic
algorithm increases more rapidly with the
size of the problem than the time
requirement for a quadratic algorithm.
Algorithms that use three nested loops are
often cubic and are practical only for small
problems.
2N
-As the size of a problem increases,
the time requirement for an exponential
algorithm usually increases too rapidly to
be practical.