Hello to all the readers!
I was reading about algorithms in computer science. I have seen that algorithms is always a complex topic for each programmer to understand in the first go. And then many of us do not really understand it correctly. Therefore, I am going through the concept of algorithms from the start. And I am writing down what I learn of algorithms from my perspective.
What Are Algorithms?
Let us understand the simplest meaning of algorithms. An algorithm or an algo is a series of instructions or steps one takes to solve a problem. Let us say I have to make a cup of tea. Then I need to know the steps in order to make it. This will involve burning the gas stove, taking a container, put water, milk, tea leaves, spices, boiling it and then filtering it in the cup. You see this is an algorithm to make tea.
Similarly in computer science, we write various programs to solve a specific problem. And each problem has an algorithm behind it. Whether we intentionally know or not but everything is being driven by an algorithm.
Importance Of Algorithms
Now let us understand why I am stressing so much on algorithms. You see there can be different ways to solve a problem. Some ways can be easy, quick to do, while others can be complex and time consuming but giving better results.
Therefore, there can be different ways to write programs to solve a problem, but then everyone wants that it should do the job in the least amount of time. That is what any human wants to get job done in the fastest time and using least resources and still delivering correct results.
So our mind needs to know what method/algo to use to solve a specific problem and by using appropriate data structures.