Week 2 Discussion Forum

Necessity of Algorithm with real life example

Necessity of Algorithm with real life example

by Md. Mazbaur Rashid (MMR) -
Number of replies: 0

Did you notice? Every code have some step by step method to solve and print the desire output. That method is called algorithm basically.

Why we need it?

Well, now as a beginner we just code for a short program (Sum of 2 numbers, leap year etc). But when we will work with a heavy project? Do you guys know? Google consists about 2 billion lines of code? The bigger the code, the more time a device will take to load as it will increase complexity. Isn't it? Did you also notice google took much time to load and find out search result before? Now? You just put a sentence in search box and press enter and strange! You get all your result in about less than 1 second! How do this happen? How can it be so fast? Yes, here is the point. They are continuously upgrading their algorithm. They are working with it to find out better algorithm which will work faster than before. Suppose we are working with for loop. If it run 100 times, basically it will take more time than 10 times right? If we can solve the same problem using for loop which will run 10 times not 100 times. Which will take less time? Of course, the code in which the for loop ran 10 times will take less time! So? That's why we need to know algorithms. We have to know many types, many algorithms to solve a single problem (code). That's why we have to study algorithms! I hope you got it guys!

262 words