



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




20 - 1
PS5 due 11:59pm Wednesday, April 18 Final Project Phase 2 (Program Outline) due 1:30pm Tuesday, April 24 Wellesley College CS Lecture 20 Tuesday, April 17 Handout # 20 - 2
20 - 3
n^3 cubic 103 106 109 1012 1015 1018 2 n exponential 103 1030 10301 103010 1030103 10301030 n^2 quadratic 102 104 106 108 1010 1012 n · log 2 n 33 664 104 1.3x 10^5 1.7x 10^6 2x 10^8 n linear 1 102 103 104 105 106 log 2 n logarithmic 3.3 6.64 9.97 13.3 16.6 19. 1 constant 1 1 1 1 1 1 function name n=10 102 103 104 105 106 f(n) = For many problems, n · log2 n and less is considered good and n3 and greater is considered bad , but really depends on the problem. E.g., linear is bad for sorted array search and exponential is the best time for Towers of Hanoi.
20 - 7
n is typically the number of elements in a collection (array, vector, list, tree, matrix, graph, stack, queue, set, bag, table, etc.) Changing the definition of n changes the analysis:
20 - 9