Pseudocode definition
Pseudocode describes an algorithm in structured language without requiring the exact syntax of a programming language.
Pseudocode in a picture
How it works
Use readable action words for assignments, choices, repetition, and output. A reader should be able to follow the steps or translate them into a program. The formatting can vary as long as the order and conditions are clear.
Worked examples
What does “for each item” mean?
Run the stated action once for every item in the collection.
What would pseudocode “if x < 0, return −x, otherwise return x” compute?
The absolute value of x.
Why indent the body of a repeated step?
It makes clear which actions repeat.
Common mistake
Use an unambiguous operation. Vague directions such as “handle the rest” leave out necessary steps.
Quick check
What word often begins a decision step?
Show answer
If.
What should pseudocode make clear at the end?
Show answer
What result is returned or how the process stops.
Sources
Flashcard
Pseudocode
Reveal the definition
Pseudocode describes an algorithm in structured language without requiring the exact syntax of a programming language.
Effortless Math. “Pseudocode.” Math Dictionary.
