In: Computer Science
In your own words, describe the purpose behind performing algorithm analysis.
C++.
An algorithm is a set of simple instructions to be followed to solve aproblem. Once an algorithm is given for a problem and decided to be correct over other algorithm's,an important step is to determine how much in the way of resources, such as time or space, the algorithm will require. The analysis of algorithms is the process of finding the computational complexity of algorithms such as the amount of time, storage, or other resources needed to execute them. Generally the analysis of algorithms involves determining a function that relates the length of an algorithm's input to the number of steps it takes or the number of storage locations it uses. An algorithm is said to be efficient when this function's values are small, or grow slowly compared to a growth in the size of the input. Differnt algorithm's show different behaviour interms of time and space complexity for the same input to perform a problem. It allows us to compare the relative costs of two or more algorithms for solving the same problem. By analysing the performances of different algorithm's, We can classify them in terms of best, average and worst case scenario for solving a problem. This helps us choose the better algorithm for solving the problem over other algorithm's.