C/algorithms in C Language
Expert: Narendra - 11/26/2005
QuestionHello sir,
My question is "how to write algorithms"?
That is, whether i need to use any specific terminology for all conditional and looping structures, creation of variables, decrement/increment of variables, etc. I can write simple programs in C, but i cannot design algorithms for which i can write programs. Can i express my ideas using general english words or should i need to confine to a specific terminology. For this reason, i failed twice in my exam (IGNOU MCA) and i am facing problems while preparing for the exam.
Please help me with your valuable suggestions and suggest a very basic book on algorithms.
Thanks a lot for your help.
Siva ram
AnswerThere are so many books on the subject in the market.
I had referred "Horowitz and Sawhni" during my engineering.
Usually students try to study algorithms along with a programming language. Many books also come like that.
But my opinion is that, we must study algorithms independently. No language should be clubbed with that.
After understanding the basic algorithms, then you can use ANY language to implement this.
So, first study and understand the algorithms.
Write algorithms on your own and try to simulate (manually) it. This will help you in writing and correcting your algorithms.
Algorithms are nothing but STEPS that you have to follow to get the result.
For example, you have to write an algorithm for adding two numbers and displaying the results.
So, what steps are needed for this.
Write the steps in basic/plain english.
This makes the begining of your algorithm.
After that, refined it by introducing some variables to store the values and results and give each step a serial number.
Hope this gives you an idea.