AppendixA

Flowcharts

In this book, the use of flowcharts has been chosen to illustrate the intrinsic logic of the algorithms discussed. The choice of this visual representation tool lies in its clarity and accessibility.

In this book, the use of flowcharts has been chosen to illustrate the intrinsic logic of the algorithms discussed. The choice of this visual representation tool lies in its clarity and accessibility, which greatly facilitates the reader’s understanding, even in the absence of prior programming knowledge.

To begin our journey, it is crucial to know the basic elements or blocks that make up flowcharts. These are mainly classified into four types:

  • Start/End
  • Input/Output
  • Branch
  • Process

The “Start/End” block marks the beginning and closure of the program flow. A flowchart can have multiple “End” blocks, but only one “Start” block. Both are represented by a rounded-edge rectangle. The start/end block diagram illustrates these blocks.

Representation of start and end in a flowchart

The “Input/Output” blocks define the inputs and outputs of the algorithm. Unlike the “Start” and “End” blocks, these can carry a descriptive name instead of a generic term, providing a more detailed view of the algorithm’s functionality. These blocks are represented through rhomboids, as shown in the input/output block diagram.

Representation of inputs and outputs in a flowchart

The “Branch” block provides the possibility of executing different actions depending on the fulfillment of a specific condition. This expands the expressiveness of algorithms and allows the incorporation of conditional logic. They are represented with a square rotated 45 degrees. The branch block diagram illustrates this block.

Representation of branches in a flowchart

Finally, the “Process” blocks indicate the actions that are performed in relation to the algorithm. Although their representation is usually abstract in most cases, these blocks usually include a more detailed description of the action being carried out. They are represented by a rectangle. The process block diagram shows how a process block is represented in a flowchart.

Representation of processes in a flowchart

In addition to the mentioned blocks, directional arrows are used to establish the order of blocks and the connections between them. These arrows generally do not contain additional information, with the exception of branches, where each arrow specifies the condition that leads to the destination block. These arrows indicate the sequence and direction of flow within the algorithm.

Throughout this book, examples of thoroughly explained and detailed flowcharts will be presented, which will allow you to effectively understand the logic of the algorithms.