Average-Case Analysis of MOQA programs
We illustrate in this section the determination, in a compositionalway, of the averagecase time of some MOQAprograms. The examples focus on sorting and search algorithms. Note that some of the resulting average-case times will differ slightly from those presented in the literature. For instance for the case of Insertionsort, some additional comparisons are counted due to the definition of the MOQAproduct operation which includes an outer while loop, involving a single comparison. In traditional Insertionsort, a single insertion process is called, based on a Push-Down operation of the i-th label of a list into a priorly sorted list of size i –1. No extra comparison is made to determine whether this process needs to be repeated. Due to the generality of the product operation, included in the pseudo-code of the Insertionsort algorithm presented below, an additional comparison will be made. This could be avoided via fine-tuning of theMOQAproduct operation adapted to this special case, which can be done without losing RB-preservation. However, rather than adapting MOQAoperations to specific algorithms, it is acceptable to have a slight increase in running time, using the standardMOQAoperations, since slight time increases are in general accepted to facilitate static timing.
KeywordsPartial Order Recurrence Equation Comparison Time Random Structure Harmonic Number
Unable to display preview. Download preview PDF.