A finite sequence of steps required to get the desired output is called an algorithm. Algorithm has a definite beginning and a definite end , and consists of a finite number of steps .

  • Algorithm is required by a programmer to clearly visualize the instructions it requires to code in order to develop a software. 
  • These also help him to identify the proper inputs and correct outputs. 
  • The purpose of using an algorithm is to increase the reliability, accuracy and efficiency of obtaining solutions.

    Example: Algorithm to find largest of two numbers

 

Characteristics of a good algorithm

  • Precision — the steps are precisely stated or defined.
  • Uniqueness — results of each step are uniquely defined and only depend on the input and the result of the preceding steps.
  • Finiteness — the algorithm always stops after a finite number of steps.
  • Input — the algorithm receives some input.
  • Output — the algorithm produces some output.

While writing an algorithm, it is required to clearly identify the following:

  • The input to be taken from the user
  • Processing or computation to be performed to get the desired result
  • The output desired by the user
Remove Ads
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh is an IIT Kanpur graduate and has been teaching for 16+ years. At Teachoo, he breaks down Maths, Science and Computer Science into simple steps so students understand concepts deeply and score with confidence.

Many students prefer Teachoo Black for a smooth, ad-free learning experience.