Lecture 17 - ECE 2574 Introduction to Data Structures and...

Info icon This preview shows pages 1–12. Sign up to view the full content.

View Full Document Right Arrow Icon
ECE 2574 Introduction to Data Structures and Algorithms Lecture 17: Algorithm Complexity: Sorting Examples Chris Wyatt Electrical and Computer Engineering and School of Biomedical Engineering and Sciences Virginia Tech
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Complexity Analysis Review There are three cases to complexity analysis best case worst case average case In each case, the number of operations as a function of the input size, n is determined. This gives the growth rate function, f(n). The complexity may be in terms of computation or space.
Image of page 2
Complexity Analysis Review Using order notation we neglect lower order terms and multipliers to give the order O( f(n)) ) Example: linked list retrieve was O(1) in the best case and O(n) in the worst case. The towers problem was O(2 n ) in all cases. Problems solvable by worst-case polynomial time are in the class P.
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Warmup #1 What is the complexity order of iterating through a list? O(n*n) 0% O(n) 85 % O(log(n)) 5 % O(1) 10 %
Image of page 4