Unpacking the rate of growth in algorithms
Let’s revisit the initial discussion on the goal of studying algorithms. One of the primary objectives is to analyze algorithms to predict their behavior and performance. This analysis is crucial for two main reasons:
- To make informed design decisions
- To understand how to design efficient and low-cost algorithms
The cost of an algorithm depends on many parameters throughout its life cycle. However, our focus here is on the cost of running an algorithm. While the costs associated with designing, maintaining, testing, and retiring an algorithm are also important, they fall outside the scope of our current discussion.
The cost of running an algorithm, or its complexity, is generally measured or estimated in two dimensions: time and space. Time complexity refers to the duration needed to produce the expected output. This assumes that the algorithm will eventually terminate, although there are instances where algorithms...