A Simple Methodology for Studying Program Time Complexity

Computer programming students need to develop an early awareness of execution time considerations. All decisions related to selection of data structures and construction of code should account for timing, yet students have few intellectual tools adequate for the task. This paper provides a simple methodology that enables college freshmen to model programs and derive bounds for their execution times. The methodology begins with a study of the program of interest and the construction of a model of its control structure. Then the syntactic parse of the model, using seven rules given in the paper, generates as a side effect the bounding time formula for the original program. Several examples are included to demonstrate the method.