CS447/547 EE667 Homework 2 - due Thursday September 10, 2009 ----------------------------------------------------- 1. Prove the following by using the definitions: (A) 2n^2 - 8n + 32 = Theta(n^2) (B) Sum_{i=1 to n) [i lg(i)] = Theta (n^2 lg(n)) (C) Sum_(i=1 to infinity) [1/(i^2)] = Theta(1) (D) 2n^2 + 8n + 32 = o(n^3). 2. Problem 3 on page 67 of the textbook. You don't need to prove anything. 3. Problem 5 on page 68 of the textbook 4. Suppose you have an array of n numbers, and you want to find the 10 largest numbers in that array. Give the running time for each of the following methods of solving this problem. You don't need to prove anything. (A) Sort the numbers and print the last 10. (B) Find the largest number, print that number, then move the last number in the array to that position. Repeat on array without considering last number. Do this process until 10 numbers are printed. (C) Create a heap, and repeatedly print the largest number 10 times. Now answer the same question for n/4 numbers instead of 10. (D) Repeat method A but now with n/4 numbers instead of 10. (E) Repeat method B but now with n/4 numbers instead of 10. (F) Repeat method C but now with n/4 numbers instead of 10.