Monday, 11 April 2016

Introduction to Algorithm and Data Structure



Problem Solving in Computer
     The main and foremost task of any computer is to solve problems. It is one of the basic requirement for any computer engineer  to understand how problems can be solved efficiently within a computer. Problem solving within a computer is a sequence of stages, following which solution for the each problem instance can be found. In most cases, the problem statement is given in a natural language (like, English). For example, "Find the maximum among  any three given integer numbers". If we had a technology, which could understand the natural languages itself, probably then we would get rid from the task of programming, because the whole concept of problem solving might have been automated. But, unfortunately, present day computer can understand only a set of restricted form of languages, known as programming languages (like, C, C++, Java etc.). So, it is the task of the computer engineer to map a problem expressed in a natural language into one of the restricted set of computer language and found the efficient solution for the problem. This is core theme of any problem solving.
     But, problem solving itself is not a very easy task. It is very difficult to find automated way of problem solving. There is no well defined theories of problem solving evolved till date, where a problem expressed in a natural language and corresponding solution is automatically generated as a sequence of steps. Partial solution to such automated problem solving has been achieved in Artificial Intelligence, but still it is a long way to go.

The Steps of Problem Solving in a Computer

     The problem solving using a computer, as we understand it, is a combination of intuition, techniques and some other aspect. One can break the task of problem solving using computer into 3 major blocks as follow:

I.  Initial Solution Set Generation

The first and foremost task of problem solving is to express the solution of a problem into a sequence of steps. Why steps? The question of steps is actually comes because of the Von-Neumann architecture, based on which all the architecture of modern computer is designed and which execute instructions as a sequence, one after another.

Solution of a problem can be generated with the help of well known theorems of mathematics, using various problem solving techniques or by the help of the experience of solving previous problems, or sometimes by once intelligence or intuition which is not yet properly understand. At this stage the issue which is seriously taken care of is the correctness of the solution. The solution set of the problem may contain more than one solution. But each solution must be expressed as a set of well-defined steps, when followed, each time produce an correct output of all the instance of the problem, after a finite sequence of steps. This set of well-defined steps is popularly known as 'Algorithm'.
 

II.      Selection of Final Solution
In this stage, the best solution of the problem among the various algorithms generated at previous stage is selected. But how could one decide which algorithm is better than the other. The main criterion of selecting an algorithm is 'Efficiency'. Efficiency of an algorithm means two things

Ø Time Complexity: Tells how fast an algorithm can produce output.
Ø Space Complexity: Tells how much memory required by an algorithm to produce output.

Efficiency of any algorithm largely depends on how the data is organised within the algorithm. And here it comes the concept of 'Data Structure', i.e. the organization of data. Algorithm design go hand in hand with data structure to produce an efficient solution of an problem.

III.    Implementation of Final Solution

Finally, comes the concept of 'Programming'. At this stage, we have an efficient solution of a problem expressed in a sequence of steps. This solution has to be feed into a computer using one of the restricted form of language. This restricted form of languages are popularly known as 'Programming Languages' (like, C, C++, Java etc.). The process of implementation of one algorithm into one of the programming language is known as 'Programming' and the implemented form of final solution in one of the programming language in known as the 'Programme'. 


So, we find that, problem solving in computer is not mealy a process of programming. It handles a lot of other issues than programming. We will further study this concept of problem solving  in great details. But before that, we want to take a close look on the terms "Algorithm", "Data Structure" and "Programming language".

No comments:

Post a Comment