Programming Algorithm Features Of Algorithm | The prominent attributes or aspect...

# Features Of Algorithm | The prominent attributes or aspect of Algorithm

-

Previously we discussed about the successive steps of algorithm through the example of Euclid’s Algorithm, see here ». Here, we will see the features of algorithm also with the example of the Euclid’s Algorithm (EA).

## Features Of Algorithm

An Algorithm has five major features. Those are – Finiteness, Definiteness, Input, Output, and Effectiveness. In this article, we will discuss each of them.

### Finiteness

One of the mejore feature of algorithm is, Finiteness. Which means, an algorithm must always terminate after a finite number of steps. EA satisfies this condition. Because, after step 1, the value of r is less then n. So, if r≠0, the value of n decreases the next time step 1 is encountered. A decreasing sequence of positive integers must eventually terminate. -So, for any given original value of n, step 1 executes only a finite number of times. Note, however, that the number of steps can become arbitrarily large.

A procedure that has all characteristics of an algorithm, but possibly lacks finiteness, may be called computational method. Euclid’s originally presented not only an algorithm for greatest common divisor of two numbers, but also a very similar geometrical construction for “Greatest common measure” of the length of two common line segments. This is computational method, which does not terminate, if the given lengths are incommensurable. Another example of a nonterminating computational method is a reactive process. -Which continually interacts with its environment. ### Definiteness

Each step of an algorithm must be precisely defined. The action to be carried out must be rigorously and unambiguously specified for each case. In Euclid’s Algorithm, the criterion of definiteness as applied to step 1. -Means that it clearly indicates exactly what it means to divide m by n and what the remainder is. In actual fact there is no universal agreement about what this means if m and n are not positive integer, what is the remainder of -8 divided by -π? Or what is the remainder of any fraction divided by zero? Therefore, the criterion of definiteness means we must make sure that the value of m and n are always positive integers. This is initially true, by hypothesis. -and after step 1, r is nonnegative integer that must be nonzero if we get to step 3. So m and n are indeed positive integers as required.

### Input

Features of Algorithm also includes the “Input” that an algorithm has zero or more inputs. Quantities which it takes initially before the algorithm begins, or, dynamically as it runs. These inputs are taken from specified sets of objects. In AE, for example, there are two inputs, namely, m and n, both are from the set of positive integers.

### Output

An algorithm has one or more outputs: quantities that have a specified relation to the inputs. EA has one output, namely n in step 2, the GCD of the two inputs. We can easily prove that, n is indeed the greatest Common Divisor (GCD). After step 1, we have

m = qn+r,

for some integer q. If r = 0, then m is a multiple of n. Clearly in such a case n is the GCD of m and n. If r ≠ 0, note that any number that divides both m and n must divide m-qn = r, and any number that divides both n and r must divide qn + r = m. So, the set of divisors of {m, n} is the same as the set of divisors of {n, r}. Therefore step 3 doesn’t change the answer to the original problem.

### Effectiveness

effectiveness is also one of the important features of Algorithm. Therefore, an algorithm is generally expected to be effective. -which is in the sense that its operations must all be sufficiently basic. Like, someone using pencil and paper, in principle does the operation exactly in a finite length of time. EA uses only the operations of dividing one positive integer by another, testing if an integer is 0, and setting the value of one variable equal to another. These operations are effective, because, it is possible to represent integer in a finite manner. -also because, there is at least one method for dividing one by another. But the same operation can not be effective, if the value involves, were arbitrary real number, specified by an infinite decimal expansion. -nor it be effective, if the values ware the lengths of physical line segments. Because them aren’t possible to specify exactly.

At the end of discussion on the features of Algorithm, we should remark that, finiteness restriction is not really strong enough for practical use. A useful algorithm should require not only a finite number of steps, but a very finite number, a reasonable number.

### Property Decorator | Getters Setters and Deleters in Python

In this article, we will talk about the Property Decorator in Python. It enables the class functionality...

### Dictionaries | HashMap in Python | Working with Key-Values

Dictionaries in Python is similar to Hashmap comparing to other languages. It stores data as a key-value...

### Hash Table | Indexing | Hashing Algorithm | Python Implementation

This article will talk about a high-level view of the Hash Table. As a programmer, this technique...

### Eigenvector Eigenvalue | Linear Algebra Fundamentals

Eigenvector ($bar{v}$) in linear algebra is a non-zero vector (matrix) that doesn't change its direction during linear...

### Pivot Table | Microsoft Excel | Create Data Insight Easily

Pivot table in microsoft Excel is an useful function that gives us a way to create insight...

### Macro Function in Microsoft Excel | Automate Repetitive Task

This article we will talk about the Macro. It is a function in microsoft excel which basically...