Educational Blog Sites

Saturday, July 22, 2017

Computer Programming Class

Lesson 2 : Nature of Algorithms

2.1 Learning Objectives
On completion of this lesson you will learn
i) algorithm
ii)  methods of writing algorithms
iii) properties of algorithms.

2.2 Definition and Properties of Algorithm
In Webster's dictionary, the word "Algorithm" is defined as "any special method of solving a certain kind of problem". But in computer science it has a special meaning. It means a step by step procedure for solving a problem by a computer. An algorithm has following properties.
1. An algorithm must be composed of a finite number of steps. Each step may be another algorithm composed of several steps.
2. Each step of the algorithm must be definite. The meaning of the operation must be clear. We cannot have an operation like "add 2 or 3 to x" in an algorithm.
3. The steps must be effective; each step can at least in principle be done by a person using pencil and paper in finite amount of time. Performing arithmetic on integers is an example of an effective operation, but arithmetic with real numbers is not necessarily effective, since some values may be expressible only by an infinitely long decimal expression
4. The algorithm may have one or more inputs but it must have at least one output.
5. An algorithm must terminate after a finite number of operations. There is another word for an algorithm which obeys all of the above properties except termination, and that is computational procedure. An operating system of a digital computer is an example of a computational procedure since it does not terminate, but continues in a waiting state until a new job is entered.

2.3 Use of Algorithm in Programming
Whenever a problem is found the method of solving it should be written in an easier way. This is called an algorithm. The step of algorithm is converted to any programming language. A lot of intelligences is required to design an algorithm. Programming means translation of an algorithm into a programming language. The study of algorithms includes many important and active areas of research. Some of these are follows in the next subsection.
2.4 How to Design an Algorithm
Designing new algorithms means finding new methods of solving problems. This is done by mathematicians or computer scientists sometimes with the help of existing algorithms. Sometimes they are developed by changing the steps which improves the computational requirements. There are several fields where algorithms can be designed. These are sorting, searching, linear programming, pattern recognition, artificial intelligence etc. To design efficient algorithms clear theoretical background on these topics is necessary. Only programming knowledge is not sufficient for this purpose.
2.5 Writing or Expressing Algorithm
Pseudocode or structured English is suitable for expressing an algorithm. Here, unlike natural languages, each statement has an unambiguous meaning. Generally algorithm is expressed in any high level language.
2.6 Analysis of Algorithm
Whenever you design an algorithm you must analyse it. You have to determine the cost of algorithm. If the cost is less than the exisiting algorithm, this algorithm will be implementable. Generally the cost of multiplication, addition and data transfer is calculated. If the cost of a new algorithm is of lower order than previous one then we are assured that the algorithm will give better results. Let us begin to implement the algorithm in a program.
Share:

1 comment:

  1. Good work done by you....
    For job news come to my site
    https://bdjobseekeraid.blogspot.com

    ReplyDelete

Translate

Total Pageviews

Search This Blog

Blog Archive

Recent Posts