LearnYourBasics

Spread your knowledge

An algorithm is a step step procedure/approach to find a solution of any problem statement. It is a well defined computational procedure that takes some set of values as input and produces set of values as output. In other words, it is a procedure for executing a calculation. Even in real world scenario, if any plan is created for any trip , 50% of the process is complete. It is a finite sei of instructions that may require one or more operations to accomplish a particular task. An algorithm is a blueprint of a given problem. 

In computer science, a step by step procedure of any problem statement is an algorithm and is implemented using a programming language. It is used to manipulate data inside data structures. An algorithm can be one or more than one for any given problem statement and the most efficient one among the algorithm’s is used. 

Features of Algorithm

  1. Finiteness – The algorithm must terminate after finite number of steps.
  2. Definiteness –  Each step of the algorithm should be described in a precised way.
  3. Effectiveness – Each step or operation should be sufficiently basic such that they can be performed in finite number of time.
  4. Input – The algorithm should have zero or more inputs
  5. Output – The algorithm should have atleast one output.

Analysis of Algorithms

Analysis of algorithms is the process of comparing different algorithms to predict their performance with respect to time and space.

There are two type of analysis – 

  • priori analysis
  • posteriori analysis

The analysis which is done before the execution of the algorithm is called priori analysis.

The analysis which is done after the execution of the algorithm is posteriori analysis.

Approaches of designing an Algorithm

  1. Top Down Approach – In this approach, an algorithm is divided into one or more segments. These segments are further divided into one or more segments if needed for the problem statement. This process is called decomposition. It is a step wise approach where the segments are created in an iterative manner until a stage is reached where no decomposition is needed. 
  2. Bottom-up Approach – It is exactly the opposite of  top down approach. In this approach, small segments are designed one by one and then proceeded towards designing a higher level segment. The small segments are integrated together at the higher level. This process continues until the required algorithm is achieved.

There are other design methods which we will discuss in the later sections.

Leave a Comment

You must be logged in to post a comment.
Scroll to Top