Assuming that you have basic knowledge about computer like when it was made,types of computer and operating system,hardware parts of computer,inventor of computer,etc,i am starting a new but important topic "ALGORITHM".
If you dont have any basic knowledge about computer,just google it.
What is an Algorithm?
An algorithm is a part of the plan for the computer program. Infact ,an algorithm is an effective procedure for solving a problem in a finite number of steps.
It is effective,which means that an answer is found and it has a finite number of steps.A welldesigned algorithm will always provide an answer,it may not be the desired anwser but there will be an answer.A welldesigned algorithm is also guaranteed to terimnated.
An Algorithm can also be defined as "finite step by step list of well defined instructions for solving a particular problem".
We always need to write algorithm for making different data structure operations.So lets understand what algorithm consist of.
In first part of algorithm we tell the purpose of algorithm.It lists for variables and input data.The second part is a list of steps.
The steps in algorithm are executed one after the other.Control may be transferred to step 'n' by using statement like 'Go to step n'.The exit and stop statements completes the algorithm.The data may be assigned to variables by using read statement and it is displayed by write or print statement.
Today,all the daily computer applications you use,someone might once have written algorithm for it which worked successfully and its result is in our hand.
Google,Facebook,Twitter,Bing,Yahoo,MSN ,etc,all are created and working successfully as their base(algorithm) had worked correctly.So,before any programmer start making something(own application),he/she should first make the algorithm as it is related to many factors like process execution time,results,etc.
Today,all the daily computer applications you use,someone might once have written algorithm for it which worked successfully and its result is in our hand.
Google,Facebook,Twitter,Bing,Yahoo,MSN ,etc,all are created and working successfully as their base(algorithm) had worked correctly.So,before any programmer start making something(own application),he/she should first make the algorithm as it is related to many factors like process execution time,results,etc.
General syntax of algorithm is given below:
ALGORITHM 1: Purpose of algorithm and input data and
variables used.
Start
Step 1: ………………………………………………………
Step 2: ………………………………………………………
:
:
Step n: …………………………………………………………….
Stop or Exit.

Different Ways Of Stating Algorithm.
Algorithm may be represented in various ways.There are four ways of stating algorithms.There steps are as follows:
 Stepform.
 Pseudocode.
 Flow chart.
StepForm Algorithm:
In the step form representation,the procedure of solving a problem is stated with written statements.Each statement solves a part of problem and these together completes the solution.The stepform uses just normal language to define each procedure.Every statement ,that defines an action,is logically related o preceding statement.
Pseudocode:
The pseudocode is a written form representation of the algorithm.However,it differs from the step form as it uses a restricted vocabulary to define its action of solving the problem.One problem with human language is that it can seem to be imprecise.But the pseudocode,which is in human language,tends towards more precision by using a limited vocabulary.
Flow chart and NassiSchneiderman:
Flow chart and NassiSchneiderman are graphically oriented representation forms.They use symbols and language to represent sequence,decision and repetition actions.
Standard flowchart symbols are given below:
To know more about sequence construct click here.
To know more about decision construct click here.
To know more about repetition construct click here.
Key Features of an Algorithm and the Stepform.
Here is an example of an algorithm,for making a pot of tea.
 If the kettle does not contain water,then fill the kettle.
 Plug the kettle into power point and switch it on.
 If the teapot is not empty,then empty the teapot.
 Place tea leaves in teapot.
 If the water in the kettle is not boiling,then go to step 2.
 Switch off the kettle.
 Pour water from the kettle into the teapot.
From this example,it is evident that algorithms show there three features:
 Sequence(also known as process).
 Decision(also known as selection).
 Repetition(also known as iteration or looping).
To know more about sequence construct click here.
To know more about decision construct click here.
To know more about repetition construct click here.
0 comments:
Post a Comment