Thursday, 18 July 2013

Definition of Algorithms

Informally, an algorithm is any well-defined computational procedure that takes
some value, or set of values, as input and produces some value, or set of values, as
output. An algorithm is thus a sequence of computational steps that transform the
input into the output.
We can also view an algorithm as a tool for solving a well-specified computational problem. The statement of the problem specifies in general terms the desired
input/output relationship. The algorithm describes a specific computational procedure for achieving that input/output relationship.

For example, we might need to sort a sequence of numbers into nondecreasing
order. This problem arises frequently in practice and provides fertile ground for
introducing many standard design techniques and analysis tools. Here is how we
formally define the sorting problem:



For example, given the input sequence {31; 41; 59; 26; 41; 58}, a sorting algorithm
returns as output the sequence {26; 31; 41; 41; 58; 59}. Such an input sequence is
called an instance of the sorting problem. In general, an instance of a problem
consists of the input (satisfying whatever constraints are imposed in the problem
statement) needed to compute a solution to the problem.

Sunday, 7 July 2013

Problem Solving Aspect

Problem solving is a creative process. It is an act of defining a problem, determining the cause of
the problem, identifying, prioritizing, and selecting alternatives for a solution and implementing a
solution.

A problem can be solved successfully only after making an effort to understand the problem. To
understand the problem, the following questions help:

- What do we know about the problem?
-What is the information that we have to process in order the find the solution?
-What does the solution look like?
-What sort of special c
ases exist?
-How can we recognize that we have found the solution?

It is important to see if there are any similarities between the current problem and other problems
that have already been solved. We have to be sure that the past experience does not hinder us in
developing new methodology or technique for solving a problem. The important aspect to be
considered in problem-solving is the ability to view a problem from a variety of angles.
There is no universal method for solving a given problem. Different strategies appear to be good
for different problems. Some of the well known strategies are:

* Divide and Conquer
*Greedy Method
*Dynamic Programming
*Backtracking
* Branch and Bound