DS - Basics

DS - Array

DS - Linked List

DS - Stack

DS - Queue

DS Hashing

DS Tree

DS - Graph

DS Programs Using C/C++

DS - Miscellaneous Topics

Algorithm and Its Properties

In this tutorial, we are going to study about what is algorithm and what are the different properties of an algorithm? Why we use algorithm? What are the benefits of algorithm over code? What is pseudo code? What is the importance of algorithm in computer programming? By Amit Shukla Last updated : August 12, 2023

What is an algorithm?

An algorithm is an effective, efficient and best method which can be used to express solution of any problem within a finite amount of space and timeand in a well-defined formal language. Starting from an initial state the instructions describe a process or computational process that, when executed, proceeds through a finitenumber of well-defined successive states, eventually producing "output"and terminating at a final ending state.

In other words, we can say that,

  1. Step by step procedure for solving any problem is known as algorithm.
  2. An algorithm is a finite set of instructions that, if followed, accomplishes a particular task.
  3. An algorithm is a sequence of computational steps that transform the input into a valuable or required output.
  4. Any special method of solving a certain kind of problem is known as algorithm.

All Algorithms must satisfy the following criteria -

  1. 1) Input
    There are more quantities that are extremely supplied.
  2. 2) Output
    At least one quantity is produced.
  3. 3) Definiteness
    Each instruction of the algorithm should be clear and unambiguous.
  4. 4) Finiteness
    The process should be terminated after a finite number of steps.
  5. 5) Effectiveness
    Every instruction must be basic enough to be carried out theoretically or by using paper and pencil.

Properties of Algorithm

Simply writing the sequence of instructions as an algorithm is not sufficient to accomplish certain task. It is necessary to have following properties associated with an algorithm.

  1. Non Ambiguity
    Each step in an algorithm should be non-ambiguous. That means each instruction should be clear and precise. The instruction in any algorithm should not denote any conflicting meaning. This property also indicates the effectiveness of algorithm.
  2. Range of Input
    The range of input should be specified. This is because normally the algorithm is input driven and if the range of input is not being specified then algorithm can go in an infinite state.
  3. Multiplicity
    The same algorithm can be represented into several different ways. That means we can write in simple English the sequence of instruction or we can write it in form of pseudo code. Similarly, for solving the same problem we can write several different algorithms.
  4. Speed
    The algorithmis written using some specified ideas. Bus such algorithm should be efficient and should produce the output with fast speed.
  5. Finiteness
    The algorithm should be finite. That means after performing required operations it should be terminate.

Comments and Discussions!

Load comments ↻

Copyright © 2024 www.includehelp.com. All rights reserved.