1.

How can we compare between two algorithms written for the same problem?

Answer»

The complexity of an algorithm is a technique that is used to categorise how efficient it is in comparison to other algorithms. It focuses on how the size of the data set to be processed affects execution time. In computing, the algorithm's computational complexity is CRITICAL. It is a good idea to categorise algorithms according to how much time or space they take up and to DESCRIBE how much time or space they take up as a function of input size.

  • Complexity of Time: The running time of a program as a function of the size of the input is known as time complexity.
  • Complexity of Space: Space complexity examines algorithms based on how much space they require to fulfil their tasks. In the early days of computers, space complexity analysis was crucial (when storage space on the COMPUTER was limited).

Note: Nowadays, a lack of space is rarely an issue because computer storage is plentiful. Therefore, it is mostly the Time Complexity that is given more IMPORTANCE while evaluating an Algorithm.



Discussion

No Comment Found