Skip to main content
Engineering LibreTexts

1.2: Activity 2 - The characteristics of an algorithm

  • Page ID
    48195
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Introduction

    This section introduces the learners to the characteristics of algorithms. These characteristics make the learner become aware of what to ensure is basic, present and mandatory for any algorithm to qualify to be one. It also exposes the learner to what to expect from an algorithm to achieve or indicate. Key expectations are: the fact that an algorithm must be exact, terminate, effective, general among others.

    Characteristics of an Algorithm

    The following are some key characteristics of an algorithm.

    1. Each step of an algorithm must be exact; this means that an algorithm must be precise and unambiguously described. This eliminates any uncertainty. It can also be said to the characteristic of precision, i.e. the steps are precisely stated (defined).
    2. Algorithms must terminate; since the ultimate aim of an algorithm is to solve a problem, then it must terminate otherwise there won't be a solution for the problem. This leads to the fact that an algorithm must have a finite number of steps in its execution. The presence of endless (infinite) loops must be avoided.
    3. An algorithm must be effective; this means that an algorithm must provide the correct answers at all times.
    4. An algorithm must be general; this means that an algorithm must solve every instance of a problem.
    5. Uniqueness: results of each step are uniquely defined and only depend on the input and the result of the preceding steps.
    6. Finiteness: the algorithm stops after a finite number of instructions are executed.
    7. Output: the algorithm produces output.

    Conclusion

    This section has highlighted the properties of algorithms to the learner who is new to the concept of data structure and algorithm. It also alerts the learner on what to do to ensure the expected outcomes can be obtained when the algorithm is implemented in any computer programming language. This will ensure the learner comes up with very correct and accurate algorithms for solving any task at hand.

    Assessment
    1. With the aid of an appropriate example, explain the characteristics of algorithm.

    1.2: Activity 2 - The characteristics of an algorithm is shared under a CC BY-SA license and was authored, remixed, and/or curated by LibreTexts.