Wednesday, August 14, 2013

What is an Algorithm..?

One of the key concepts of computer science is to use “Algorithms” to resolve problems, algorithms are the basics when approaching a problem that should be resolved with Min defects.


In other words, we can explain algorithms as basic instructions that should resolve the problem at the end, a good algorithm should always use the following rules: 


  • Every step must be easy to understand.
  • All steps must be set with logical order.
  • Every step must be one that user can actually perform.


A clear example can explain this issue:

The Problem: we need to send E-mail to our boss

Algorithm:

1.      Open your computer.
2.      Open your E-mail platform.
3.      Press ‘New’ mail
4.      Add the boss info

-          Address : B@test.com
-          Subject: Test Main
-          Mail body: You’re the best!
5.      Press ‘Send’.

After this example, we can explain why algorithms must contain the 3 rules:

Clear - every step in our algorithms must return the same result, if the user needs to ‘Send’ mail  he always need to press the ‘Send’ button. But if we perform step 4 without providing the mail details user can add whatever he wants, therefore the result could be different.

Ordered - every algorithm uses the ‘Start’ operation (step 1) and closed with the last order to perform (step 5). If the user executing the algorithm with different order the outcome will never be as expected.



Executable - every step in our algorithm must be executable, if one of the orders cannot achieve that we can say clearly that we failed. 


No comments:

Post a Comment

My Presentations