1.2 Characteristics of Algorithm

1.2 Characteristics of Algorithm

Characteristics of an Algorithm

Input Requirements

  • An algorithm must accept zero or more inputs, indicating flexibility in its design. Some algorithms may not require any input at all.

Output Necessity

  • Every algorithm must produce at least one output; otherwise, it serves no purpose. This is akin to a function in C language that, despite having no parameters, still returns a result.

Definiteness of Statements

  • Each statement within an algorithm should be clear and unambiguous, possessing a single meaning. If humans cannot solve a problem, computers cannot either.

Finiteness of Execution

  • An algorithm must have a finite number of steps and eventually terminate. While it can contain many statements, it should not run indefinitely without stopping.

Effectiveness and Relevance

  • Algorithms should avoid unnecessary statements; every step must contribute towards achieving the objective. This principle parallels procedures in scientific experiments or cooking recipes where each step has significance.

Examples of Procedures

Importance of Clear Objectives

  • Just like chemical experiments or cooking recipes require specific ingredients and apparatus to yield results, algorithms need defined objectives to ensure they produce meaningful outputs.

Known Steps Only

  • All steps performed in an algorithm must be known and understood; there should be no ambiguity or "magical" elements involved in the process.

Conclusion on Effectiveness

Playlists: Algorithms
Video description

Characteristics of Algorithms PATREON : https://www.patreon.com/bePatron?u=20475192 Courses on Udemy ================ Java Programming https://www.udemy.com/course/java-se-programming/?referralCode=C71BADEAA4E7332D62B6 Data Structures using C and C++ https://www.udemy.com/course/datastructurescncpp/?referralCode=BD2EF8E61A98AB5E011D C++ Programming https://www.udemy.com/course/cpp-deep-dive/?referralCode=E4246A516919D7E84225