Skip to main content Accessibility help
×
Hostname: page-component-848d4c4894-2xdlg Total loading time: 0 Render date: 2024-07-01T14:56:43.106Z Has data issue: false hasContentIssue false

A - Pseudocode Conventions

Published online by Cambridge University Press:  05 June 2012

Gerard Tel
Affiliation:
Universiteit Utrecht, The Netherlands
Get access

Summary

Rather than presenting the algorithms in this book as programs written in an existing programming language, a pseudocode is used for the formal description of algorithms. Pseudocode is concise and “user-friendly”, where a real program is often obscured by details concerning a rigid syntax.

Pascal-like pseudocode. The pseudocode used in this book very much resembles the language Pascal. An algorithm is usually given as the local algorithm of a process of the system, whose name is used as a subscript to the variables of the program. Process names can be used as array indices, and set variables are used. The variable Neighp is the set of processes to which p is connected (the neighbors of p).

Assignment (“a := expression”), conditional statement (“if conditionthenstatement”, with an optional “elsestatement” part), and loop (“whileconditiondostatement”) are used with the same meaning as in Pascal. The forall statement has the form “forallxXdostatement”, where x is a formal parameter and X a set, and means that statement will be executed for each element x of X in turn. The order in which the elements get their turn is not specified, but the s atement is only used where the order does not matter.

Type
Chapter
Information
Publisher: Cambridge University Press
Print publication year: 2000

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

  • Pseudocode Conventions
  • Gerard Tel, Universiteit Utrecht, The Netherlands
  • Book: Introduction to Distributed Algorithms
  • Online publication: 05 June 2012
  • Chapter DOI: https://doi.org/10.1017/CBO9781139168724.019
Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

  • Pseudocode Conventions
  • Gerard Tel, Universiteit Utrecht, The Netherlands
  • Book: Introduction to Distributed Algorithms
  • Online publication: 05 June 2012
  • Chapter DOI: https://doi.org/10.1017/CBO9781139168724.019
Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

  • Pseudocode Conventions
  • Gerard Tel, Universiteit Utrecht, The Netherlands
  • Book: Introduction to Distributed Algorithms
  • Online publication: 05 June 2012
  • Chapter DOI: https://doi.org/10.1017/CBO9781139168724.019
Available formats
×