Login Register






The Importance of Algorithm in Programming filter_list
Author
Message
The Importance of Algorithm in Programming #1
Hello HC,
I want to write my first article about the importance of algorithm in programming. I hope this will be helpful for those who new to programming..

So.. What is the algorithm?
Algorithm is describing a process step by step.
When we are making a programme, we explain each step of the process to computer. We can think this as teaching how to ride a bicycle to a six year old.
Lets make an algorithm of how to ride a bicycle for example..


Step-1: Get on the bicycle.
Step-2: Grab the steering wheel with your hands.
Step-3: Put your left feet on left pedal.
Step-4: While pressing the left pedal with left feet, put your right feet on the right pedal.
Step-5: While pressing the right pedal with right feet, rise your left feet.
Step-6: While pressing the left pedal with left feet, rise your right feet.
Step-7: Return to Step-5.


This is the simpliest example of an algorithm.
While we make programmes, we must build a solid algorithm. Weak algorithms may cause unwanted errors and/or bugs. It even may get our software be hacked.

For example there is an error in the algorithm we've just made. We haven't tell the kid how to stop the bike. As you can guess it may end up fatal results.
So we have to develop our algorithm like this..


Step-1: Get on the bicycle.
Step-2: Grab the steering wheel with your hands.
Step-3: Put your left feet on left pedal.
Step-4: While pressing the left pedal with left feet, put your right feet on the right pedal.
Step-5: While pressing the right pedal with right feet, rise your left feet.
Step-6: While pressing the left pedal with left feet, rise your right feet.
Step-7: If you want to stop, go to Step-8; Else, return to Step-5.
Step-8: Grasp the breaks of the bicyle with your fingers.
Step-9: Stop the bicycle by squeezing them.


As you can see, we prevent fatal results by developping our algorithm.
The logic of algorithms is the same in programming. The only difference is that we use programming languages to communicate with computers.

I want to end my article here. Feel free to fix my mistakes Cool
Also don't hold back your comments too Biggrin

Au revoir..
Fuck You.

Reply

RE: The Importance of Algorithm in Programming #2
Sweet idea of presenting it to the newcomers.

Reply

RE: The Importance of Algorithm in Programming #3
Short but precise.
Also shouldn't this be in Programming section?
Visual Basic.Net

Private Message me for help

I'm not active because I'm busy with school.

Reply

RE: The Importance of Algorithm in Programming #4
(06-24-2013, 04:29 AM)XxGreenLanternxX Wrote: Short but precise.
Also shouldn't this be in Programming section?

It was in the Programming section but community manager relocated it to here.
Fuck You.

Reply

RE: The Importance of Algorithm in Programming #5
(06-24-2013, 04:29 AM)XxGreenLanternxX Wrote: Short but precise.
Also shouldn't this be in Programming section?

LOLing...originally I had told the Author on Skype to put it in the programming section. However, after I read the material myself, and judging by the response from others, it served more the purpose of a Tutorial subject wise, leading me to relocate it here.

Reply

RE: The Importance of Algorithm in Programming #6
(06-25-2013, 04:09 AM)Linuxephus™ Wrote:
(06-24-2013, 04:29 AM)XxGreenLanternxX Wrote: Short but precise.
Also shouldn't this be in Programming section?

LOLing...originally I had told the Author on Skype to put it in the programming section. However, after I read the material myself, and judging by the response from others, it served more the purpose of a Tutorial subject wise, leading me to relocate it here.

I think this should be in the Coding forum under Other Languages however you have moved it here so there's no problem with that Confusedmiling:
[Image: OilyCostlyEwe.gif]

Reply

RE: The Importance of Algorithm in Programming #7
(06-25-2013, 04:53 AM)Psycho_Coder Wrote: I think this should be in the Coding forum under Other Languages however you have moved it here so there's no problem with that Confusedmiling:

That's exactly where I originally had moved it from.:lol:
But being unsure if that was the correct section reading as this was in the teaching (infer tutorial) type of subject, I moved it here.
However, after your commenting reflects the same as GreenLanterns, consider it [re]relocated to the original section affective immediately.Biggrin

Reply

RE: The Importance of Algorithm in Programming #8
@RootTheSystem You made a good attempt to explain the importance of algorithm in programming and that bicycle example was humorous however I have some comments which might help you with your understanding. First of all this thread is not like a tutorial to me as it Is quite short and lacks details for such a nice topic. Algorithms are LIKE blue prints of a program which gives all the details and functionality involved in finding the solution to a problem. It is important as we can build a program on any platform with the help of an algorithm. An algorithm is independent of any programming language.

You have said "Weak algorithms may cause unwanted errors and/or bugs" , I think any week algorithm will do the same job job with out errors else it cannot be called an algorithm instead week algorithms makes the software or your code slow and takes more memory space. Time and Space complexity is what Algorithm mainly deals with. At the present era we are more concerned about Time complexity that is making things fast without using much resources.

I think you should have given real algorithms and then implemented them in a program. For example, generate primes with a range with a normal approach this would be a test code and then implement the same using the Sieve of Eratosthenes algorithm for generating primes with a range.

I hope you understand!

A bit of fun and humour Biggrin
Spoiler:
[Image: 1016511_527588887289994_96661052_n.jpg]


Thank you,
Sincerely,
Psycho_Coder
[Image: OilyCostlyEwe.gif]

Reply

RE: The Importance of Algorithm in Programming #9
(06-25-2013, 05:36 AM)Psycho_Coder Wrote: @RootTheSystem You made a good attempt to explain the importance of algorithm in programming and that bicycle example was humorous however I have some comments which might help you with your understanding. First of all this thread is not like a tutorial to me as it Is quite short and lacks details for such a nice topic. Algorithms are LIKE blue prints of a program which gives all the details and functionality involved in finding the solution to a problem. It is important as we can build a program on any platform with the help of an algorithm. An algorithm is independent of any programming language.

You have said "Weak algorithms may cause unwanted errors and/or bugs" , I think any week algorithm will do the same job job with out errors else it cannot be called an algorithm instead week algorithms makes the software or your code slow and takes more memory space. Time and Space complexity is what Algorithm mainly deals with. At the present era we are more concerned about Time complexity that is making things fast without using much resources.

I think you should have given real algorithms and then implemented them in a program. For example, generate primes with a range with a normal approach this would be a test code and then implement the same using the Sieve of Eratosthenes algorithm for generating primes with a range.

I hope you understand!

A bit of fun and humour Biggrin
Spoiler:
[Image: 1016511_527588887289994_96661052_n.jpg]


Thank you,
Sincerely,
Psycho_Coder

First of all thank you for your comment Smile I tried to explain the importance of algorithm. English is not my main language so there may be grammar mistakes or expression disorders.. Also I actually lol'd that sleeping algorithm Biggrin That one is that I truly need now since I'm not sleeping for 28 hours Biggrin
Fuck You.

Reply