Published online by Cambridge University Press: 05 June 2012
Two resources coveted by software developers are memory space and execution time. Among the factors that determine the memory footprint of an application or its execution time is the algorithm chosen in the application (there may of course be many algorithms used within an application).
The space taken by an algorithm is related to the information structure used to hold the data and any other information structures required to support the computational process. These are usually defined as fields in the data structure class.
The time required to execute an algorithm is dependent on the structure of the algorithm. We are usually concerned with the worst-case time, the best-case time, and the average time, to be defined in the following paragraphs. Sometimes these are the same. These execution times are usually related to one or more parameters that determine the size of the problem being solved. To be conservative we normally rely on worst-case time when comparing two algorithms.
The worst-case time is the longest time that any problem of specified size takes to execute. The best-case time is the shortest time that any problem of specified size takes to execute. The average-case time is an estimate of the time required for an average problem of specified size.
For worst-case, best-case, and average-case times, we are normally concerned with asymptotic time complexity – in plain English, the time required to complete an algorithm as a function of problem size when the problem size is assumed to be large.
To save this book to your Kindle, first ensure [email protected] is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.
Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.
Find out more about the Kindle Personal Document Service.
To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.
To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.