Pseudocode Conventions

Peter Occil


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


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


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.



Pseudocode Notes

In the pseudocode:


This page is licensed under Creative Commons Zero.