Download presentation
Presentation is loading. Please wait.
1
Analysis of Algorithms Growth Rates
Department of Computer and Information Science, School of Science, IUPUI CSCI 240 Analysis of Algorithms Growth Rates Dale Roberts, Lecturer Computer Science, IUPUI
2
Choosing n in t(n) The analysis of algorithms attempts to optimize some critical resource. The critical resource usually chosen is time, so t(n) represents a time function. t(n) is influenced by hardware and compiler. Other factors include the algorithm used and input to the algorithm. Parameter n, usually referring to number of data items processed, affects running time most significantly. n may be degree of polynomial, size of file to be sorted or searched, number of nodes in a graph, etc.
3
Best Case, Worse Case and Average Case Defined
Best case is amount of time program would take with best possible input configuration best case is found for input and easier to find; not usually the metric chosen Worst case is amount of time program would take with worst possible input configuration worst case is found for input and easier to find; usually the metric chosen Average case is amount of time a program is expected to take using "typical" input data definition of "average" can affect results average case is much harder to compute
4
Average Case and Worse Case
An algorithm may run faster on certain data sets than on others. Finding the average case can be very difficult, so typically algorithms are measured by the worst-case time complexity. Also, in certain application domains (e.g., air traffic control, surgery, IP lookup) knowing the worst-case time complexity is of crucial importance.
5
Comparison of Growth Rates
Functions in Increasing Order
6
Comparison of Growth Rates (cont)
7
Comparison of Growth Rates (cont)
8
Comparison of Growth Rates (cont)
9
Comparison of Growth Rates (cont)
10
Comparison of Growth Rates (cont)
11
Acknowledgements Philadephia University, Jordan Nilagupta, Pradondet
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.