chap algorithm analysis seen so far it is reasonable to assume that it takes fixed amount of time to do one such comparisonregardless of the value of the two integers or their positions in the array because the most important factor affecting running time is normally size of the inputfor given input size we often express the time to run the algorithm as function of nwritten as (nwe will always assume (nis non-negative value let us call the amount of time required to compare two integers in function largest we do not care right now what the precise value of might be nor are we concerned with the time required to increment variable because this must be done for each value in the arrayor the time for the actual assignment when larger value is foundor the little bit of extra time taken to initialize currlarge we just want reasonable approximation for the time taken to execute the algorithm the total time to run largest is therefore approximately cnbecause we must make comparisonswith each comparison costing time we say that function largest (and the largest-value sequential search algorithm in generalhas running time expressed by the equation (ncn this equation describes the growth rate for the running time of the largestvalue sequential search algorithm example the running time of statement that assigns the first value of an integer array to variable is simply the time required to copy the value of the first array value we can assume this assignment takes constant amount of time regardless of the value let us call the amount of time necessary to copy an integer no matter how large the array on typical computer (given reasonable conditions for memory and array size)the time to copy the value from the first position of the array is always thusthe equation for this algorithm is simply (nc indicating that the size of the input has no effect on the running time this is called constant running time