Published online by Cambridge University Press: 05 June 2012
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 “forallx ∈ Xdostatement”, 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.
To save this book to your Kindle, first ensure no-reply@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.
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.
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.