Advertisement

We provide several examples of well-known algorithms for sorting and searching, programmed in MOQA. Two new sorting algorithms are introduced, Percolating Heapsort and Treapsort, based on the MOQAdeletion operation. Percolating Heapsort provides the first randomness preserving version of Heapsort.

In the following examples Xdenotes the input S-variable while Zdenotes the output S-variable.

We adopt the convention in the presentation thatMOQAalgorithms when called on orders of size 0 or 1 act as the identity operation, i.e. will simply return the datalabeling of a partial order of size 0 or 1.

Moreover, when referring to a call to a basic operation on an S-variable X, we assume implicitly that the data-labeling stored in the variableXis reset to the output data-labeling computed by the basic operation. For instance, we will refer to Top(X) as opposed to [X:= Top(X)] in the pseudo-code.

Keywords

Partial Order Binary Tree Selection Phase Random Structure Sorting Algorithm 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer Science+Business Media, LLC 2008

Personalised recommendations