exam1Answers - Answers to exam 1 Section 1 of CSE 331...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Answers to exam 1 Section 1 of CSE 331 Spring 2008 The average was 71 with N=47; high score was 96 and low in the 40's. An average of 75 would have been better. While there were 15 strong performances, many students can easily find another 5 points they could have scored. The histogram of scores is as follows: < 60 60-69 70-79 80-89 90-100 8 13 11 12 3 ANSWERS: None of these should have been difficult, since all were encountered in class or on homework. Avg was probably 13; should have been at least 16. 1) O(N log N) avg quicksort 2) O(N^2) avg case insertion sort 3) O(N) assuming the find is included O(1) otherwise; either OK 4) O(N log N) to build an AVL tree (tree sort) 5) O(N log N) to do N/2 ops on a splay tree 6) O(N) do post order processing of AVL tree to destruct it 7) O(N) to merge O(log N) unsorted items with an array of N sorted (HW problem) 8) O(N^2) obvious nested for loops 9) O(2^N) total nodes in perfect tree is 2^h+1 10) O(N^3) first series is sum of N squares, which is known to be O(N^3) 11) f(n) is Big Omega of g(n) iff there exist positive constants c and n0, such that f(n) >= c g(n) for all n>=n0. (g(n) is an asymtotic lower bound for f(n).) Suppose n0 = 2. Then, for n>=n0, n^3 > n^2. So, 2 n^3 - n^2 + 3 >= n^3 + 3 > n^3 > n^2. Therefore, f(n) >= c g(n) for c = 1 and all n >=2 = n0. The class did fairly well on this. 12) Do in class. Overall, the class needs improvement on induction. 13) Here are three different approaches that students provided. The class overall did well on this problem, but a few missed solving it. Despite new power from
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

exam1Answers - Answers to exam 1 Section 1 of CSE 331...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online