Algorithmic
analysis
It is frequently important to know
how much of a particular resource (such as time or storage) is theoretically
required for a given algorithm. Methods have been developed for the analysis
of algorithms to obtain such quantitative answers (estimates); for example,
the sorting algorithm above has a time requirement of O(n), using the big
O notation with n as the length of the list. At all times the
algorithm only needs to remember two values: the largest number found so far,
and its current position in the input list. Therefore it is said to have a
space requirement of O(1), if the space required to store the input
numbers is not counted, or O(n) if it is counted.
Different algorithms may complete
the same task with a different set of instructions in less or more time, space,
or 'effort' than others. For example, a binary search algorithm
usually outperforms a brute force sequential search when used for table lookups on sorted lists.
Formal
versus empirical
Main articles: Empirical algorithmics,
Profiling (computer programming), and Program optimization
The analysis and study of
algorithms is a discipline of computer science, and is often
practiced abstractly without the use of a specific programming language
or implementation. In this sense, algorithm analysis resembles other
mathematical disciplines in that it focuses on the underlying properties of the
algorithm and not on the specifics of any particular implementation. Usually pseudocode is used for analysis as it is the simplest and most general
representation. However, ultimately, most algorithms are usually implemented on
particular hardware / software platforms and their algorithmic efficiency
is eventually put to the test using real code. For the solution of a "one
off" problem, the efficiency of a particular algorithm may not have
significant consequences (unless n is extremely large) but for algorithms
designed for fast interactive, commercial or long life scientific usage it may
be critical. Scaling from small n to large n frequently exposes inefficient
algorithms that are otherwise benign.
Empirical testing is useful because
it may uncover unexpected interactions that affect performance. Benchmarks
may be used to compare before/after potential improvements to an algorithm
after program optimization.
FFT
speedup
To illustrate the potential
improvements possible even in some extremely "well established"
algorithms, a recent significant innovation, relating to FFT algorithms
(used very heavily in the field of image processing), may have decreased
processing times by a factor as high as 10,000 . The impact of this speedup
enables, for example, portable computing devices (as well as other devices) to
consume less power.
From : Wikipedia
From : Wikipedia
Tidak ada komentar:
Posting Komentar