I am currently studying algorithms and algorithmic design, and I am confused those terms. What is the difference between them?
Thank you.
Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. It only takes a minute to sign up.
Sign up to join this communityI am currently studying algorithms and algorithmic design, and I am confused those terms. What is the difference between them?
Thank you.
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.
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.
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: 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].
$^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:
$^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).