What is an algorithm ?
Algorithm is a step by step procedure which solves the problem.Characteristics of an Algorithm.
1. DefinitenessAll steps are accurate.
2. Input
Algorithm has one or more inputs,or else there cannot be any.
3.Outputs
There are several outputs in one Algorithm.
4.Effectiveness
Is the basis to write a program.
5. Finiteness
It terminates after finite number of steps.
Pseudo-Codes
Pseudo stands for nearly and pseudo-codes means nearly the code.The Pseudo-Codes can be converted to programming codes easily.SEQUENCE is a linear progression where one task is performed sequentially after another
WHILE is a loop (repetition) with a simple conditional test at its beginning
IF‐THEN‐ELSE is a decision (selection) in which a choice is made between two alternative courses of action.
REPEAT‐UNTIL is a loop with a simple conditional test at the bottom
CASE is a multi‐way branch (decision) based on the value of an expression. CASE is a generalization of IF‐THEN‐ELSE
FOR is a "counting" loop
------------------ See you in next tutorial -----------------
0 comments:
Post a Comment
Ask anything about this Tutorial.