chap algorithm analysis run them on suitable range of inputsmeasuring how much of the resources in question each program uses this approach is often unsatisfactory for four reasons firstthere is the effort involved in programming and testing two algorithms when at best you want to keep only one secondwhen empirically comparing two algorithms there is always the chance that one of the programs was "better writtenthan the otherand that the relative qualities of the underlying algorithms are not truly represented by their implementations this is especially likely to occur when the programmer has bias regarding the algorithms thirdthe choice of empirical test cases might unfairly favor one algorithm fourthyou could find that even the better of the two algorithms does not fall within your resource budget in that case you must begin the entire process again with yet another program implementing new algorithm buthow would you know if any algorithm can meet the resource budgetperhaps the problem is simply too difficult for any implementation to be within budget these problems can often be avoided by using asymptotic analysis asymptotic analysis measures the efficiency of an algorithmor its implementation as programas the input size becomes large it is actually an estimating technique and does not tell us anything about the relative merits of two programs where one is always "slightly fasterthan the other howeverasymptotic analysis has proved useful to computer scientists who must determine if particular algorithm is worth considering for implementation the critical resource for program is most often its running time howeveryou cannot pay attention to running time alone you must also be concerned with other factors such as the space required to run the program (both main memory and disk spacetypically you will analyze the time required for an algorithm (or the instantiation of an algorithm in the form of program)and the space required for data structure many factors affect the running time of program some relate to the environment in which the program is compiled and run such factors include the speed of the computer' cpubusand peripheral hardware competition with other users for the computer' resources can make program slow to crawl the programming language and the quality of code generated by particular compiler can have significant effect the "coding efficiencyof the programmer who converts the algorithm to program can have tremendous impact as well if you need to get program working within time and space constraints on particular computerall of these factors can be relevant yetnone of these factors address the differences between two algorithms or data structures to be fairprograms derived from two algorithms for solving the same problem should both be