Pseudocode Conventions

Peter Occil

Introduction

This document explains the conventions and common functions used in some of my articles that use pseudocode.

Symbols

In addition to the familiar +, -, * (multiplication), and / (division) operators, other symbols are defined below.

Loops

Pseudocode may use while loops, which are self-explanatory.

Pseudocode may also use for loops, defined as follows:

Lists and Files

In the pseudocode, lists are indexed starting with 0. That means the first item in the list has index 0, the second item in the list has index 1, and so on, up to the last item, whose index is the list’s size minus 1.

In this context, a list is to be understood as a resizable array of items, not as a linked list.

A list can be expressed by wrapping items in brackets; for example, [0, 1, 2] is a three-item list.

Functions

Notes:

Pseudocode Notes

In the pseudocode:

License

This page is licensed under Creative Commons Zero.