31-10-2012, 05:50 PM
Fundamental Programming concepts - Algorithm
Fundamental Programming.doc (Size: 289.5 KB / Downloads: 21)
Overview
Algorithm is used to simplify a given task. It is a solution to a problem that is independent of any programming language. It is an explicit step-by-step procedure for producing a solution to a given problem.
This presentation covers the basic features and concepts of Algorithm. In addition it covers the need of algorithm, structure of algorithm and concepts of algorithm
An algorithm is:
A finite sequence of steps
Each step shall be explicit and unambiguous
For each input, it shall terminate in finite time with output
A program is an algorithm expressed in a programming language
Different definition of algorithm is:
An explicit step-by-step procedure for producing a solution to a given problem
In mathematics and computer science an algorithm (the word is derived from the name of the Persian mathematician Al-Khwarizmi) is a finite set of well-defined instructions for accomplishing some task which, given an initial state, will terminate in a corresponding recognizable end-state (contrast with heuristic). Algorithms can be implemented by computer programs, although often in restricted forms; mistakes in implementation and limitations of the computer can prevent a computer program from correctly executing its intended algorithm.
Analyzing an Algorithm
There are different approaches of algorithm in analyzing a problem
• Empirical (a posteriori) approach
o It is a method consisting of programming the competing techniques and trying them on different instances
o The empirical approach to choosing an algorithm consists of programming the competing techniques and trying them on different instances with the help of a computer
• Theoretical (a priori) approach
o It determines mathematically the quantity of resources needed by each algorithm as a function of the size of the instances
The theoretical approach consists of determining mathematically the quantity of resources needed by each algorithm as a function of the size of the instances. The resources of most interest are computing time and storage space, with the former usually being the more critical.
We compare the algorithms on the basis of their execution times, an algorithm’s storage requirements.