2 Notion of Algorithm.docx

# In such situations the performance analysis of

This preview shows pages 2–5. Sign up to view the full content.

 In such situations the performance analysis of algorithms is realized by experimental measurements and statistical methods . In general, the analysis of an algorithm is achieved in two steps: (1) The a priori analysis  Presumes the assessment from temporal point of view of the used operations and their relative cost .  In a priori analysis, the result is a function (of some relevant parameters) which bounds the algorithm‘s computing time. (2) The a posteriori testing supposes the following steps:  Establishing a convenient number of sets of input data, which presumably cover all the behavior possibilities of the algorithm.  Executing the algorithm for each input set and collecting actual statistics about algorithm’s consumption of time and space while it is executing.  Build the algorithm’s profile – the precise amount of time and storage the algorithm consumes. Conclusion : A priori analysis has as objective to determine the order of magnitude of the algorithm’s execution time .

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
The a posteriori test has as objective to determine the algorithm’s profile. 2.3 Asymptotic Notation The order of growth of the running time of an algorithm [CLR92]: Gives a simple characterization of the algorithm's efficiency . Allows us to compare the relative performance of alternative algorithms. The study of the asymptotic efficiency of algorithms means to use at input sizes large enough to make only the order of growth of the running time relevant. We are concerned with how the running time of an algorithm increases with the size of the input, as the size of the input increases without bound. Usually an algorithm that is “asymptotically more efficient” will be the best choice for all but very small inputs. 2.3.1 Θ -notation (teta) Θ -notation is used to express the limit of the growth order of the running time of an algorithm . Definition : For a given function g(n) ) we denote by Θ(g(n)) the set of functions defined as follows [CLR92]: ------------------------------------------------------------ Θ (g(n)) = { f(n) : there exist positive constants c 1 , c 2 and n 0 such that 0 c 1 g(n) f(n) c 2 g(n) for n n 0 } [2.3.1.a] ------------------------------------------------------------ A function f(n) belongs to the set Θ (g(n)), if there exist positive constants c 1 and c 2 such that it can be "sandwiched" between c 1 g(n) and c 2 g(n) , for sufficiently large n .
Fig.2.3.a . Representation of f(n) = Θ (g(n)) Although Θ (g(n)) is a set , we write " f(n)= Θ (g(n)) " to indicate that f(n) is a member of Θ (g(n)) , or " f(n) Θ (g(n)) ". This abuse of equality to denote set membership may at first appears confusing, but we shall see later in this section that it has advantages [2.3.1.b]. ------------------------------------------------------------ f(n)= [2.3.1.b] (g(n)) Θ ------------------------------------------------------------ Figure 2.3.a gives an intuitive picture of functions f(n) and g(n), where f(n)= Θ (g(n)).

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern