fast as ( (the running time of our algorithmfor the worst-case inputwe would say the algorithm is "in ( in the worst case the following is precise definition for an upper bound (nrepresents the true running time of the algorithm (nis some expression for the upper bound for (na non-negatively valued functiont(nis in set ( ( )if there exist two positive constants and such that ( <cf (nfor all constant is the smallest value of for which the claim of an upper bound holds true usually is smallsuch as but does not need to be you must also be able to pick some constant cbut it is irrelevant what the value for actually is in other wordsthe definition says that for all inputs of the type in question (such as the worst case for all inputs of size nthat are large enough ( )the algorithm always executes in less than cf (nsteps for some constant example consider the sequential search algorithm for finding specified value in an array of integers if visiting and examining one value in the array requires cs steps where cs is positive numberand if the value we search for has equal probability of appearing in any position in the arraythen in the average case (ncs / for all values of cs / <cs thereforeby the definitiont(nis in (nfor and cs example for particular algorithmt(nc in the average case where and are positive numbers thenc < sot( <cn for and thereforet(nis in ( by the definition example assigning the value from the first position of an array to variable takes constant time regardless of the size of the array thust(nc (for the bestworstand average caseswe could say in this case that (nis in (choweverit is traditional to say that an algorithm whose running time has constant upper bound is in ( just knowing that something is in ( ( )says only how bad things can get perhaps things are not nearly so bad because we know sequential search is in (nin the worst caseit is also true to say that sequential search is in ( but