0
$\begingroup$

I am currently studying algorithms and algorithmic design, and I am confused those terms. What is the difference between them?

Thank you.

$\endgroup$
3
  • 2
    $\begingroup$ Good question. However, I cannot see any search and research effort. Can you list/copy and paste the definitions you have seen in your study of computer science or programming? The more, the better. $\endgroup$
    – John L.
    Nov 23, 2018 at 2:50
  • $\begingroup$ I really made a research about it but ı confused.Many sorces say that “Every algorithm is a program but every program may not be algorithm”.In that point , I extremely confused. $\endgroup$ Nov 23, 2018 at 7:34
  • 5
    $\begingroup$ I do not doubt that you have made quite some research. However, you did not show any in the question. What you are supposed to do is simple. Show at least one definition or explanation or reference for each type in the question. NOT in the comments. Every reader then does not have to search/check the same definition/explanation again and they can check the reference url or paper easily. In that way, you will build you case as well as help people answer efficiently, faster, and more effectively. $\endgroup$
    – John L.
    Nov 23, 2018 at 8:05

1 Answer 1

3
$\begingroup$

These terms are often used very loosely and to mean different things. The definitions below uses Wikipedias definitions as an outset, but tries to make them more clear and formal. Being this strict is usually not needed in practice.

Program

Computer Program: A collection of instructions that performs a specific task when run$^{1}$ by a computer [Wikipedia].

These instructions can be expressed in low level assembly or in some high level language in the source code. To be able to run the program the instructions must be represented as machine instructions for the targeted CPU.


Process

Computer Process: An instance of a computer program that has been "loaded" to virtual memory$^2$ [Wikipedia].

In contemporary operating systems a process can be in several states, such as running (i.e., being processed by the CPU) or waiting [Wikipedia].


Algorithm

Algorithm: An unambiguous specification, that can be expressed within a finite amount of space and time, and in a well-defined formal language, for calculating a function [Wikipedia].

Most programs includes one or more algorithms, but they also do other things, such as side effects (e.g., I/O operations) [Wikipedia].


Footnotes

$^1$ The Wikipedia article actually uses "executed" which is a very common verb to use in this case. There is two reasons why "run" or "being processed" could be preferable:

  1. When a CPU is processing instructions it does more than just executing them: the other actions are usually defined as fetching instructions and decoding instructions.
  2. As is shown in the definition for process, the term running is usually used when referring to this.

$^2$ The Wikipedia article actually uses "executed" (again) which is a very common verb to use in this case as well. For the same reasons as above, some other terminology can be preferable if one needs to be precise.

In addition, due to the process states, it might not even be running either, just being in the virtual memory space (i.e., in RAM or swapped).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.