Time Complexity
摘要
In the realm of informatics and computational analysis, it is important to understand the efficiency of a program or calculation procedure. This chapter presents an exploration of time complexity, a fundamental metric that underpins computational efficiency. The chapter begins by showing the definition and representation of time complexity. It delves into the fundamental understanding of how time complexity depicts the relation between input data size and the time required for execution. It provides perspectives for perceiving time complexity from a polynomial expression of the number of instructions. Furthermore, it demonstrates how to infer time complexity directly from flowcharts—a visual representation introduced in the previous chapter. By comparing two cases different in time complexity, the chapter showcases how the analytical insights gained through time complexity can inform the efficiency of a program. By dissecting polynomials and flowcharts in the skill-enhancing exercises, learners will sharpen their ability to assess time complexity in diverse contexts.