Search This Blog

Friday, July 10, 2009

DEFINATION AND OTHER ABOUT ALGORITHM

Q.1: What is an algorithm? Describe different criteria of an algorithm.

Ans: Definition: The word algorithm comes from the name of a Persian author, Abu Ja’far Mohammed ibn Musa al Khowarizmi (c. 825 A.D.). In computer science, “algorithm” refers to a method that can be used for the solution of a problem. An algorithm is a finite set of instructions that, if followed, accomplishes a particular task.

Criteria: All algorithms must satisfy the following criteria:



  1. Input: Zero or more quantities are externally supplied.

  2. Output: At least one quantity is produced.

  3. Definiteness: Each instruction is clear and unambiguous.

  4. Finiteness: If we trace out the instructions of an algorithm, then for all cases, the algorithm terminate after a finite number of steps.

  5. Effectiveness: Every instruction must be very basic so that it can be carried out, in principle by a person. Each operation is definite and it must be feasible.


Q.2: What are the important and active areas of research of an algorithm? Or describe the distinct area of algorithm.

Ans: There are four distinct areas of study we can identify.



  1. How to device an algorithm: Creating an algorithm is an art which may never fully automate.

  2. How to validate algorithms: Once an algorithm is devised, it is necessary to show that it computes the correct answer for all possible legal inputs. This process is called algorithm validation. The purpose of the validation is to assume us that this algorithm will work correctly independently of the issue concerning the programming language it will eventually be written in.

  3. How to analyze algorithms: When an algorithm executes, it uses the computers CPU to perform operations and its memory to hold the program and data. Analysis of algorithm or performance analysis refers to the task of determining how much computing time and storage requires the algorithm.

  4. How to test a program: Testing a program consists of two phases: debugging and profiling. Debugging is the process of executing programs on simple data sets to determine whether a faulty result occurs and correct them. Profiling or performance measurement is the process of executing a correct program on data sets and measuring the time and space it takes to compute the result.


Q.3: Describe the Pseudocode Conventions of algorithm specification.

Ans: Algorithm Specification (Pseudocode Convention): The most algorithms using a Pseudocode that resembles C and Pascal are given bellow:



  1. Comments begin with // and continue until the end of line.

  2. Blocks are indicated with matching braces: {and}.

  3. An identifier begins with a letter. The data types of variables are not explicitly declared.

  4. Assignment of values to variables is done using the assignment statement.                                     <variable> := <expression>;

  5. Elements of multi dimensional arrays are accessed using [and].

  6. for, while and repeat until looping statements are employed.

  7. In order to produce boolean values true or false, the logical operations and, or, not and the relational operators <, ≤, =, ≠, ≥ and > are provided.

  8. A conditional statement has the following for m:


if <condition> then <statement>

if <condition> <statement 1> else <statement 2>



  1. Input and output are done using the instructions read and write.

  2. There is only one type of procedure: Algorithm. An algorithm consists of a heading and a body. The heading and a body. The heading takes the form


Algorithm Name (<parameter list>).     

No comments:

Post a Comment