Algorithm and program

An algorithm is a set of ordered, finite, and delimited instructions that are created in order to systematically describe the execution of a task.

Algorithms are in common use on a day-to-day basis, and can be found in user manuals, instructions for executing a plan, or guides for executing processes. However, the use of the term is more common in the field of programming.

A program is a logical sequence of instructions to perform specific tasks on a computer. Said sequences are written in code and are designed by programmers, using one or more algorithms.

The difference between an algorithm and a program is that although they both refer to a series of instructions, algorithms can be written in code or natural language, while programs can only be written in programming language.

Furthermore, algorithms can be executed by a human being, while programs are designed to be executed by machines.

AlgorithmProgram
DefinitionInstructions to describe the execution of a task by machines or humans.Instructions to describe the execution of a task on a computer.
Characteristics
  • Precision.
  • Finitude.
  • Definition.
  • Readability.
  • Stability.
  • Speed.
  • Usability
  • Upgrade.
Types
  • Qualitative.
  • Quantitative.
  • Computational.
  • Not computational.
  • Imperatives
  • Declarative
  • System
  • Of application
Examples
  • Recipes.
  • Addresses.
  • Artifact manuals.
  • Source code.
  • PHP
  • Java
  • iOs
  • Windows
  • Excel
  • Word

What is an algorithm?

It is a sequence of steps that is created in order to explain a process that has a beginning and an end. This series of instructions must be expressed in concrete terms, in such a way that there is no doubt about what needs to be done for the execution to be successful.

The term algorithm comes from the Greek arithmos (number), and is commonly used in computer science, programming, and mathematics.

However, an algorithm can not only be expressed in numbers, but also in words. Any activity or event with a beginning and an end that has a series of logical steps to achieve its execution can be expressed through an algorithm. And these are usually represented by flow charts.

Parts of an algorithm

Every algorithm is made up of three parts, which are essential for the instructions to be executed.

  • Entry : are the essential requirements to carry out the instructions.
  • Process : it is the body of keys, instructions or steps to follow to execute the algorithm.
  • Output : is the resolution or end of the process.

Characteristics of the algorithms

Every algorithm must have some basic characteristics to be executed correctly.

  • They are precise : the instructions must be specific and cannot be ambiguous.
  • They are finite : no matter how many steps a process has, it must have a beginning and an end.
  • They have to be defined : the algorithms always have to give the same result, regardless of how many times they are executed.
  • They describe three elements : input, process, and output.
  • They must be legible : the instructions have to be easily read.

Types of algorithms

In computing, there are four types of algorithms, classified according to the use (or not) of numerical calculations and computational devices

  • Qualitative algorithms : they do not require numerical calculations for their execution. Instead, logical sequences must be executed. For example, a recipe or instructions for assembling an artifact.
  • Quantitative algorithms : require numerical calculations, such as the solution to an equation.
  • Computational algorithms : they require numerical operations that must be solved using a calculation device, such as a computer or calculator. Very complex equations or codes that can only be interpreted by a machine are examples of this type of algorithm.
  • Non-computational algorithms : it is not necessary to execute a calculation operation, or failing that, the sequence can or must be executed by a human being. Practical examples of non-computational algorithms are simple numerical calculations, or directions to get to a place.

What is a program?

A program is a set of instructions or algorithms designed to be interpreted and executed by a computer. Although the term software is often used as a synonym, the reality is that a program is only a part of the software , and this in turn is composed not only of programs, but also of databases and other types of files.

The instructions or commands of a program are written in programming language, and depending on the language used, these can be executed directly on the computer (like all .exe programs in the Windows operating system ) or need an interpreter. In this case, we speak of compilation, which is the process of “translating” the programming language with which the program has been written into the machine language of the device on which it will be executed.

Characteristics of a program

Every program is expected to comply with these characteristics so that it can function efficiently.

  • Stability : a program should execute its task without fail, and if this happens, it should have data recovery options.
  • Speed : the program should run in a reasonable time and without interfering with other instructions.
  • Usability : a program has to be easy to understand and use by the user.
  • Update : any program should be continuously improved to new versions that adapt to the needs of the device and the user.

Types of programs

Programs can be classified into two types: according to their type of programming language and according to their functions or tasks.

Programs according to their type of programming language

In the field of programming there are two paradigms: imperative and declarative.

  • Imperative language programs : in this case, the instructions are executed in a sequence. These types of programs are described in such a way that the conditions or steps to be followed allow their modification in order to execute a task. Languages ​​like Java and PHP belong to this category.
  • Declarative language programs : the commands are described in the form of declarations that, although they allow us to understand the problem to be solved, do not assign a sequence of steps to solve it. And unlike imperative programs, they cannot be modified. Scala and Elixir are two types of declarative programs.

Programs according to their functions

Depending on the tasks you run, a program can be system or application.

  • System programs : they are the set of commands necessary to execute all the functions of a computer. In addition, they are those that allow to control or exchange data with the hardware , or physical elements of the computer. The Windows operating system in a set of system programs.
  • Application programs: their function is to carry out specific tasks that facilitate the use of the device by the user. They can be included in the system software or they can be installed separately. Word processors (such as Word ), spreadsheets, and the image editor are some application programs.

You may also be interested in:

Add a Comment

Your email address will not be published. Required fields are marked *