as an examplethe following program fragmentwhich has (nwork followed by ( workis also ( )fori ++ ai fori ++ forj ++ ai +aj jrule --if/else for the fragment ifcondition else the running time of an if/else statement is never more than the running time of the test plus the larger of the running times of and clearlythis can be an overestimate in some casesbut it is never an underestimate other rules are obviousbut basic strategy of analyzing from the inside (or deepest partout works if there are function callsthese must be analyzed first if there are recursive functionsthere are several options if the recursion is really just thinly veiled for loopthe analysis is usually trivial for instancethe following function is really just simple loop and is ( )long factorialint ifn < return else return factorialn )this example is really poor use of recursion when recursion is properly usedit is difficult to convert the recursion into simple loop structure in this casethe analysis will involve recurrence relation that needs to be solved to see what might happenconsider the following programwhich turns out to be terrible use of recursion long fibint ifn < return else return fibn fibn )at first glancethis seems like very clever use of recursion howeverif the program is coded up and run for values of around it becomes apparent that this program