chap algorithm analysis going up to the rightas increases (you might want to sketch this graph for yourself before reading furthernowimagine the graph showing the cost for each instance of the problem of finding the maximum value among (say elements in an array the first position along the axis of the graph might correspond to having the maximum element in the first position of the array the second position along the axis of the graph might correspond to having the maximum element in the second position of the arrayand so on of coursethe cost is always thereforethe graph would be horizontal line with value you should sketch this graph for yourself nowlet' switch to the problem of doing sequential search for given value in an array think about the graph showing all the problem instances of size the first problem instance might be when the value we search for is in the first position of the array this has cost the second problem instance might be when the value we search for is in the second position of the array this has cost and so on if we arrange the problem instances of size from least expensive on the left to most expensive on the rightwe see that the graph forms diagonal line from lower left (with value to upper right (with value sketch this graph for yourself finallylets consider the cost for performing sequential search as the size of the array gets bigger what will this graph look likeunfortunatelythere' not one simple answeras there was for finding the maximum value the shape of this graph depends on whether we are considering the best case cost (that would be horizontal line with value )the worst case cost (that would be diagonal line with value at position along the axis)or the average cost (that would be diagonal line with value / at position along the axisthis is why we must always say that function (nis in ( ( )in the bestaverageor worst caseif we leave off which class of inputs we are discussingwe cannot know which cost measure we are referring to for most algorithms multiple parameters sometimes the proper analysis for an algorithm requires multiple parameters to describe the cost to illustrate the conceptconsider an algorithm to compute the rank ordering for counts of all pixel values in picture pictures are often represented by two-dimensional arrayand pixel is one cell in the array the value of pixel is either the code value for the coloror value for the intensity of the picture at that