Appendix 3 Pseudocode: Flashcards
Pseudocode:
Pseudocode is
an intermediate step between an English language description of the steps of a procedure
and a specification of this procedure using an actual programming language. T
Procedure Statements:
The pseudocode for an algorithm begins with a procedure statement that gives the name of
an algorithm, lists the input variables, and describes what kind of variable each input is.
procedure maximum(L: list of integers)
Assignment:
and other types of statements:
variable := expression
interchange a and b
Comments:
In the pseudocode in this book, statements enclosed in curly braces are not executed. Such
statements serve as comments or reminders that help explain how the procedure works.
{x is the largest element in L}
Loop Constructions: for:
for variable := initial value to final value
block of statements
OR
for all elements with a certain property
While:
while condition
block of statements
Conditional Constructions
if condition 1 then statement 1 else if condition 2 then statement 2 else if condition 3 then statement 3 ⋅ ⋅ ⋅ else if condition n then statement n else statement n + 1
Loops within loops:
Indentation