Appendix 3 Pseudocode: Flashcards

1
Q

Pseudocode:

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Procedure Statements:

A

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Assignment:

and other types of statements:

A

variable := expression

interchange a and b

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Comments:

A

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}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Loop Constructions: for:

A

for variable := initial value to final value
block of statements

OR

for all elements with a certain property

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

While:

A

while condition

block of statements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Conditional Constructions

A
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Loops within loops:

A

Indentation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly