Lecture 17

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

• Notes
• 49

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

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

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

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.
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.

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

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 %