1.8.2 Limits on Time and Storage

Programs carry out certain basic operations. For example, primes executes assignment statements, evaluates conditions, and executes set, insert, omit, and belongs. In fact, its total execution time equals the number of times each of the operations is executed multiplied by the time taken by that operation. Determining the number of basic operations performed by a program to solve a problem allows evaluation of its practicality. For illustration, suppose that 1,000,000 basic operations can be carried out in 1 second by a computer. Then the number of basic operations that it can carry out in 1 year is

1,000,000 basic operations/second ?/FONT> 60 seconds/minute ?/FONT> 60 minutes/hour ?/FONT> 24 hours/day ?/FONT> 365 days/year

This is fewer than 1013 basic operations/year, and this is assuming that the computer is available for the exclusive use of the program and that it will never fail during the year. Thus 1013 can be taken as a benchmark figure?/FONT>any program that requires a number of operations on this order to solve a problem is not feasible!

How much storage is available is determined by your computer system. The amount needed is surely not feasible when your program aborts during execution with a message indicating insufficient storage, or when the compiler tells you there is insufficient storage. If you run out of time or storage, you must then abandon the problem (and perhaps your job), find a more efficient program, or trade time for storage.