1 / 11

Department of Computer and Information Science, School of Science, IUPUI

Department of Computer and Information Science, School of Science, IUPUI. CSCI 240. Analysis of Algorithms Growth Rates. Dale Roberts, Lecturer Computer Science, IUPUI E-mail: droberts@cs.iupui.edu. Choosing n in t(n).

moriah
Download Presentation

Department of Computer and Information Science, School of Science, IUPUI

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Department of Computer and Information Science,School of Science, IUPUI CSCI 240 Analysis of Algorithms Growth Rates Dale Roberts, Lecturer Computer Science, IUPUI E-mail: droberts@cs.iupui.edu

  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

More Related