This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: c + 3 c + · · · + n c a. Show that S(n) is O(n c+1 ) Big O = upper bound, and n c+1 = n*n c , so you have n n c terms. When you add the previous terms from 1 c to n c , it is strictly less than adding n c terms. b. ? Show that S(n) is Ω(n c+1 ). Big Omega = lower bound 5a. using n = 2 k a 1 = 1, a k+1 = 2a k , so 1, 2, 4, 8, 16, . .. What is the smallest k for which a k ≥ n? N/A 5b. using n = 2 k a 1 = 2, a k+1 = a k 2 What is the smallest k for which a k ≥ n? a k = 2, 4, 16, 196, . .. 1 6a. False 6b. False 6c. False 7a. So you have j levels with d children at most per node, which means d j maximum nodes. 7b. Depth k = largest level, which means k d maximum nodes at that level, so k d + (k1) d + . .. + 1 d . So O(k d ). 7c. n nodes and d children. So minimum depth = floor(log d (n))  1 depth, so O(log d (n)). 8a. n1, n2. O(log n). O(n log n). Yes 8b. max 2 n1, 2 n2, but it really depends. O(2 n ). O(n*2 n ), which is O(2 n ). No...
View
Full Document
 Spring '08
 staff
 Algorithms, NC, 3k, 2k, Big theta

Click to edit the document details