Algorithm

The words ‘algorithm’ and ‘algorism’ come from the name of a Persian mathematician called ‘Al-Khwārizmī’, he is practically from my homeland. (Persian: خوارزمی, c. 780–850).

In mathematics and computer science, an algorithm (/ˈælɡərɪðəm/ is a finite sequence of rigorous instructions, typically used to solve a class of specific problems or to perform a computation. Algorithms are used as specifications for performing calculations and data processing. More advanced algorithms can use conditionals to divert the code execution through various routes (referred to as automated decision-making) and deduce valid inferences (referred to as automated reasoning), achieving automation eventually. Using human characteristics as descriptors of machines in metaphorical ways was already practiced by Alan Turing with terms such as “memory”, “search” and “stimulus”.
— Wikipedia

In general, it’s, set of finite step-by-step instructions for solving some problem (logical or mathematical), or to perform some other task, for example something from real world, like problem solving and computation. In other words a strict set (sequence) of instructions for completing a specific task.

Algorithm are used as specifications for performing computation and data processing.

In computing, an algorithm is a precise list of operations that could be done by a Turing machine. For the purpose of computing, algorithms are written in pseudocode, flowchart, or programming language.

Sometimes, it’s possible to have two different algorithms that accomplish the same task complexity. But one algorithm can be faster/slower than the other by orders of magnitude.

Often there is more than one way to achieve a particular computing goal, and the algorithm you choose can seriously affect the speed of your code.

Simple flowchart how I see programming and place of algorithms in it:

  +----------------+
  |    Computer    |
  +----------------+
          |
          v
  +----------------+
  |     Data       |
  +----------------+
          |
          v
  +----------------+
  |   Algorithm    |
  +----------------+
          |
          v
+--------------------+
| Code & programming |
| language           |
+--------------------+
          |
          v
  +----------------+
  |       Me       |
  +----------------+

Algorithm time complexity is?::How long does it take to run algorithm X with N data.

Algorithm space complexity::Amount of memory space required to solve algorithm X with N input data.

Formalized way to describe algorithm time and space complexity is Big O Notation.

How many computations will be used in algorithm X is an algorithmic ==efficiency=.