Saturday, August 16, 2008

Algorithms and pseudocodes

An algorithm is a set of precisely stated, finite sequence of executable steps for solving a problem. It is written using informal English-like statements known as Pseudocode.

There's usually 3 parts to an algorithm -- the input, logic and lastly output.

The algorithm to find the maximum of 3 numbers a, b, c should be written as follows:

INPUT a,b,c //this is the INPUT part

IF (a>b) max=a //this is the LOGIC part
ELSE max=b
IF (max< c) max=c

OUTPUT max //this is the OUTPUT part

And this is just the algorithm...... One still got to translate it into a program. Once im done with all this i'll be able to design my own blog skin!! Anws, this is just the second week. And ive yet to blog about physics and chemistry.... which just goes to show where the two of em stand in my list.

12 more weeks to go till the first of 8 exams. 8 exams provided i clear each exams once. Still managing to remain in pace with time.

No comments: