If you find this question on google you will get a definition "It is a process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer." But when i had seen this definition initially, i wasn't able to understand anything. Since i know this by now so let me help you to understand it.
Algorithm is a process of doing some work lets suppose you are given rice and pulse to cook something, now it depends on your algorithm(process of doing something) that whether the output will be rice and curry or it will be khichdi. Here you have seen the data was same for both cases that is rice and pulse but the output was different.
In programming different algorithm is used to obtain different outputs and even for single output different algorithms can be used, its kind of a pathway to reach destination, you can choose any path. But the less time your path take the better that algorithm will be called.
Top comments (0)