Monday, 12 October 2015

Introduction to Algorithms

Let's try to gain some knowledge on Algorithm...

Hey what ?
Al-go-rith-um ?

Yes, You have correctly pronounced it.
And take a note, 'An algorithm is just another recipe.'

Recipe for what ?

Are you going to teach me different cake baking recipes ?
Not at all. I am not going to teach you how to cook a good mutton dish or bake a Chocolate Cake. Instead I am going to discuss something related to Programming.

Hey Palash, have you gone out of your mind ?
No dear, I am completely in a stable state of my mind and  I am writing this article with all my senses working.

Then how can a programming stuff be a recipe ?
Well, if you think of any recipe, it eventually becomes a set of steps to follow with some ingredients, to give you a delicious food/drink.

Wait, let me think of that Chocolate Shake.

  • Take a glass of milk
  • Take some sugar
  • Take some ice
  • Take some Cocoa Powder
  • Mix sugar into milk
  • Continuously stir the sugar into the milk until the sugar gets dissolved
  • Mix some cocoa powder into the milk
  • Continuously stir the sugar into the milk until the powder gets dissolved and the content becomes thick
  • Add ice cubes into the milky solution
  • Sprinkle some coca powder as toppings
Hmm, you are correct. It is a set of some steps which involves some ingredients.
Oh dear, I am glad that you are agreeing with me and thanks for confirming that to me.

But, what's the point here ? How it is related to programming ?
It is 100% related. Just take look on this article to know why.

Hmm, it is good to know that a program runs my computer and my computer has nothing special without it. Now I understand why you are repeatedly telling about recipe.

Great !!!

Now, again if you think, how many ways you know to perfectly blend a deliciously glass of Chocolate Shake, you will know what algorithm is.

Hmm, I have a better alternatives to make chocolate shake.

Hmm, not only the banana shake recipe, we use different algorithms for our day to day activities.Just go through this article. You will get some funny examples to compare with.

With all these keeping in mind, let's dive into a formal informal definition of Algorithm,

Algorithm: Informally, an algorithm is any well-defined computational procedure that takes some value, or set of values, as input and produces some value, or set of values, as output. An algorithm is thus a sequence of computational steps that transform the input into the output.

Well, with this, I am going to put an end for the day. We'll discuss more in our subsequent sessions.

Keep watching this space for more !!!
Palash Kanti Kundu

No comments:

Post a Comment