This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Solutions to CSE 331 Sample Mid-term Please do not read anything into the kind of problems in the sample mid-term. In particular, to save myself time I copied one problem from the homeworks. (Further, instead of spelling out the solutions in this document I might refer you to the corresponding homework solutions.) The actual mid term problems will not be such straight-forward lifts. Overall, the mid-term will be a bit harder than this sample mid-term (but still much easier than the homeworks). The main purpose of this sample mid-term was to give you an idea of the format of questions. The actual mid term will also have true/false questions followed by two other questions (with same points). 1. (4 10 = 40 points ) Answer True or False to the following questions and briefly JUSTIFY each answer. A correct answer with no or totally incorrect justification will get you 4 out of the total 10 points. (Recall that a statement is true only if it is logically true in all cases while it is is false if it is not true in some case). (a) For any instance of the stable marriage problem with n men and n women, there are n ! = n ( n- 1) ... 1 many possible perfect matchings. True . See Solution to Problem 3 in HW0. (b) Consider f ( n ) = log log n and g ( n ) = 10 10 10 10 10 10 . Then f ( n ) is O ( g ( n )). False . g ( n ) is a constant (albeit a big one) and does not increase with n . However, f ( n ) does increase with n (though slowly). Thus, for some large enough n , g ( n ) f ( n ) and thus, g ( n ) is O ( f ( n )) (and not the other way round). (c) For any graph, there is a unique BFS tree for it. False . Consider the cycle on four vertices: v 1 ,v 2 ,v 3 ,v 4 such that ( v i ,v i +1 ) for 1 i 3 and ( v 4 ,v 1 ) are the edges. Consider a BFS run that starts from v 1 ....
View Full Document
- Fall '11