An algorithm is a set of instructions to solve a particular problem. There can be multiple solutions for a single problem.
The performance of an algorithm is determined by the resource required by an algorithm to perform a particular task. The most common resources taken into consideration for determining the performance of an algorithm are:
- Time: The time required to complete the task of that algorithm (Time Complexity)
- Space: Space required by the program and data (Space Complexity)
Other factors like complexity and feasibility to implement an algorithm are also considered.
Algorithms with the least time and space complexity are chosen.
Time complexity and space complexity is discussed in next article.
Categories: Data Structure and Algorithm
Leave a Reply