Posts

Performance Analysis of an Algorithm

Image
What is Performance Analysis of an algorithm? If we want to go from city "A" to city "B", there can be many ways of doing this. We can go by flight, by bus, by train and also by bicycle. Depending on the availability and convenience, we choose the one which suits us. Similarly, in computer science, there are multiple algorithms to solve a problem. When we have more than one algorithm to solve a problem, we need to select the best one. Performance analysis helps us to select the best algorithm from multiple algorithms to solve a problem. When there are multiple alternative algorithms to solve a problem, we analyze them and pick the one which is best suitable for our requirements. The formal definition is as follows... Performance of an algorithm is a process of making evaluative judgement about algorithms. It can also be defined as follows... Performance of an algorithm means predicting the resources which are required to an algorithm to perform its ta...

Introduction to Algorithms

Image
  What is an algorithm? An algorithm is a step by step procedure to solve a problem. In normal language, the algorithm is defined as a sequence of statements which are used to perform a task. In computer science, an algorithm can be defined as follows... An algorithm is a sequence of unambiguous instructions used for solving a problem, which can be implemented (as a program) on a computer. Algorithms are used to convert our problem solution into step by step statements. These statements can be converted into computer programming instructions which form a program. This program is executed by a computer to produce a solution. Here, the program takes required data as input, processes data according to the program instructions and finally produces a result as shown in the following picture. Specifications of Algorithms Every algorithm must satisfy the following specifications... 1.        Input -  Every algorithm must take zero or more n...