Skip to main content

Table 1 Classes of instructions in algorithms

From: Algorithm

Instruction class

Definition

Input

Gathers input from outside the system

Output

Present output to outside the system

Assignment

Assigns the given value to a semi-persistent or persistent memory location, often called a variable

Retrieval

Loads values from persistent memory locations into transitory memory locations

Primitive

Perform primitive operations on transitory memory values such as basic arithmetic and text manipulation

Loop

These instructions control the flow of the algorithm so that a subset of instructions is executed repeatedly.

Conditionals

These control the flow of instructions and execute alternative sets of instructions based on a value in transitory memory.