Page Nav

HIDE

Grid

GRID_STYLE

Algorithm

Hi Welcome back guys In the previous we discussed about what is logic building and algorithms I just gave you a short idea about it but in...

Hi Welcome back guys

In the previous we discussed about what is logic building and algorithms I just gave you a short idea about it but in today’s post I tell you how to develop a algorithm and then eventually develop a program. 

If you directly come to this blog then do refer my previous post :- C programming language.

Programming part of that algorithm we discussed later otherwise you get confused and I don’t want it to happen.

And don’t worry we surely develop a program for all the algorithms that we going to discussed so not do worry so now without wasting any time let’s head back to the topic.  

Algorithm

Algorithm is the finite set of statements each of which has clear meaning and can be executed. Algorithm is the way to write the program.

As when you building a tower or house firstly the builder or engineer provide you with the design layout and give the specifications of where is kitchen, bedroom etc.

They give you the idea that after the architecture get fully developed how it will look.

 Same logic is there for the Algorithms.

 Algorithms provide you the way how to start the program at which end and how to end the program. So when can also say like that “Algorithm is nothing, but the program”. 

Algorithm characteristics 
1)    Well-Defined Inputs:-If in any algorithm you are giving an input then it should be well-defined inputs just like in algorithm you have entered the gender wrong you have entered female it should be male.

So this can’t happen it should be defined in advance of why we are using the male gender and it’s importance.  


Well-Defined Outputs:- Algorithms should give the well-defined outputs it was not like it goes to infinite loop, end the execution without giving the result etc.

Many of you might think that why I use the word execution as we are writing the algorithm but eventually what is algorithm it is the nothing but the program. 

As simple as that. 


3)    Feasible:- The Algorithm must be feasible.

Feasible in the sense that it is simple, easy to understand and based on practical life.

It should also adapt the correctness, consistency and of course the accuracy.

 

4)    Finite-ness:-The Algorithm should be finite. Means it should not end up with the Infinite loop or any.

Suppose you are using the for loop and because of the condition is always true and it will not go to false state.

So in that case we can say that the algorithm is not finite.

 

5)    Clear and Unambiguous:- Algorithm must be clear and understandable in all sense like you are using the word that has two meaning and according to sentence also we are getting the 2 different meaning of that word so in that case it leads to ambiguity(confusion).

So our main motto is that don’t use that word or express your sentence differently in the algorithm.

Keep it as simple as you can. 

 

 

6)    Language-Independent:- This is an very useful characteristic of algorithm.it should be language-Independent meaning that it doesn’t matter that you are writing it in English, Marathi, Hindi, Chinese, Japanese etc.

Important is the content of that algorithm how much it is simple and easy to understand by all. 


No comments