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 commonly used 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 realm of programming.
A program is a logical sequence of instructions to execute 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 both refer to a series of instructions, algorithms can be written in code or in 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.
Algorithm Program Definition Instructions 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. Update. Qualitative types. Quantitative. computational. Not computational. Declarative imperatives Of 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 has to be done for the execution to be successful.
The term algorithm comes from the Greek arithmos (number), and is commonly used in computing, programming, and mathematics.
However, an algorithm can not only be expressed in numbers, but also in words. Any activity or event with a start and end that has a series of logical steps to achieve its execution can be expressed through an algorithm. And these are usually represented by flowcharts.
parts of an algorithm
Every algorithm is made up of three parts, which are essential for the instructions to be executed.
Entrance: are the essential requirements to carry out the instructions.
Process: This is the body of keys, instructions or steps to follow to execute the algorithm.
Exit: is the resolution or end of the process.
Algorithm characteristics
Every algorithm must have some basic characteristics to be executed correctly.
they are accurate: instructions must be specific and cannot give rise to ambiguities.
are finite: No matter how many steps a process has, it must have a start and an end.
They have to be defined: 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 easy to read.
Algorithm types
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: require numerical operations that must be solved using a calculating device, such as a computer or calculator. Highly 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 else the sequence can or must be executed by a human being. Practical examples of non-computational algorithms are simple numerical calculations, or instructions 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 is often used software are synonymous, the reality is that a program is only a part of the softwareand this in turn is made up 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, they can be executed directly on the computer (like all .exe programs of the operating system windows) 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
It is expected that all programs comply with these characteristics so that they can work efficiently.
Stability: A program should execute its task without crashing, and if it does, it should have data recovery options.
Speed: the program should execute in a reasonable amount of time and without interfering with other instructions.
usability: a program has to be easy to understand and use by the user.
Update: Every 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 following a sequence. These types of programs are described in such a way that the conditions or steps to follow 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 statements 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 it executes, a program can be system or application.
system programs: are the set of commands necessary to execute all the functions of a computer. In addition, they are the ones that allow you to control or exchange data with the hardware, or physical elements of the computer. The operating system windows in a set of system programs.
Application Programs: its function is to execute specific tasks that facilitate the use of the device by the user. They may be included in the software system or can be installed separately. Word processors (such as word), spreadsheets and image editor are some application programs.
You may also be interested in: