algorithm analysis algorithms are designed to solve problemsbut given problem can have many different solutions how then are we to determine which solution is the most efficient for given problemone approach is to measure the execution time we can implement the solution by constructing computer programusing given programming language we then execute the program and time it using wall clock or the computer' internal clock the execution time is dependent on several factors firstthe amount of data that must be processed directly affects the execution time as the data set size increasesso does the execution time secondthe execution times can vary depending on the type of hardware and the time of day computer is used if we use multi-processmulti-user system to execute the programthe execution of other programs on the same machine can directly affect the execution time of our program finallythe choice of programming language and compiler used to implement an algorithm can also influence the execution time some compilers are better optimizers than others and some languages produce better optimized code than others thuswe need method to analyze an algorithm' efficiency independent of the implementation details complexity analysis to determine the efficiency of an algorithmwe can examine the solution itself and measure those aspects of the algorithm that most critically affect its execution time for examplewe can count the number of logical comparisonsdata interchangesor arithmetic operations consider the following algorithm for computing the sum of each row of an matrix and an overall sum of the entire matrixtotalsum version for in rangen rowsum[ for in rangen rowsum[irowsum[imatrix[ ,jtotalsum totalsum matrix[ ,