Characteristics of good algorithms, Data Structure & Algorithms

What do we mean by algorithm? What are the characteristics of a good and relevant algorithm?

An algorithm is "a step-by-step procedure for finishing some task'' An algorithm can be specified in many ways. For example, it can be written down in English (or French, or any other language). However, we are interested in algorithms which have been specifically specified using an appropriate mathematical formalism--such as a programming language.

Each and Every algorithm should have the following five characteristics:

1.Input characteristics: The algorithm should be taking zero or more input.

2. Output characteristics: The algorithm should be producing one or more outputs.

3. Definiteness characteristics: All the steps of algorithm should be defined unambiguously.

4. Effectiveness characteristics: A person should be able to calculate the values involved in the process of the algorithm using paper and pencil.

5. Termination characteristics: An algorithm must terminate after a finite number of steps which means it should not be infinite.

 

Posted Date: 7/9/2012 9:47:44 PM | Location : United States






Your posts are moderated
Related Questions
Q. Let X = (X1, X2, X3,....Xn) and Y= (Y1, Y2, Y3,....Xm) be the two linked lists respectively. Write down an algorithm to merge the lists together to get the linked list Z such th

Q. The two Binary Trees are said to be similar if they are both empty or if they are both non- empty and left and right sub trees are similar. Write down an algorithm to determine

QUESTION (a) Construct a binary tree for the following numbers assuming that a number greater than the node (starting from the root) goes to the left else it goes to the right.

pseudo code for fibonnaci series

algorithm for insertion in a queue using pointers

You have to design a framework of a Genetic Algorithm (GA) with basic functionality. The basic functionality includes representation, recombination operators, tness function and se

A spanning tree of any graph is only a subgraph that keeps all the vertices and is a tree (having no cycle). A graph might have many spanning trees. Figure: A Graph

A binary tree of depth "d" is an almost complete binary tree if  A) Every leaf in the tree is either at level "d" or at level "d-1"  B)  For any node "n" in the tree with a

since the gregorian calendar was introduced in 1752,a leap year occurs every 4 years.you are to write a pseudo code to find out whether a year is a leap year.your progrm should dis

INSERT FUNCTION /*prototypes of insert & find functions */ list * insert_list(list *); list * find(list *, int); /*definition of  anyinsert function */ list * inser