Skip to main content
  • 345 Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 109.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Rights and permissions

Reprints and permissions

Copyright information

© 2008 Springer Science+Business Media, LLC

About this chapter

Cite this chapter

(2008). Examples of MOQA Programs. In: A Modular Calculus for the Average Cost of Data Structuring. Springer, Boston, MA. https://doi.org/10.1007/978-0-387-73384-5_8

Download citation

  • DOI: https://doi.org/10.1007/978-0-387-73384-5_8

  • Publisher Name: Springer, Boston, MA

  • Print ISBN: 978-0-387-73383-8

  • Online ISBN: 978-0-387-73384-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics