ABSTRACT

Windows and Web applications in the previous chapters consist of event-driven subroutines. Each subroutine implements an algorithm that takes an input and produces the correct output. The running time of an algorithm is the time from taking the input to producing the correct output. The running time of an algorithm determines the computing efficiency of the algorithm, which has a direct impact on the performance and the user satisfaction of an application. In this chapter, we introduce the basics of analyzing the computing efficiency of an algorithm by describing how to analyze the running time of a non-recursive algorithm. A non-recursive algorithm does not involve a function or a procedure calling the function or the procedure itself. We introduce asymptotic notations that specify the computing efficiency of an algorithm by defining the order of the running time when the size of inputs is large. With an understanding of the computing efficiency of an algorithm, we illustrate why the computing efficiency of an algorithm is important even when the processing speed of computers has become fast.