practice-mid2 - in a set of real numbers(See the text for...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CSci 5421: Practice Questions for Midterm 2 1(a) State the properties that a set system M = ( S, I ) must satisfy to be a matroid. (b) Let G = ( V,E ) be an undirected graph. Let I be the set of all subsets of E that do not contain cycles. Prove that M = ( E, I ) is a matroid. A clear, well-articulated proof is expected. 2. In class it was shown that a red-black tree with n internal nodes has height at most 2log( n +1). Show that this bound is asymptotically tight, i.e., describe a red-black tree on n nodes and height h for which the ratio h/ 2log( n +1) approaches 1 as n approaches inFnity. (The tree is not unique.) 3. State the General Augmentation Theorem (GAT) for red-black trees. Suppose that you are given a red-black tree with n keys, where each node stores one or more additional Felds. Your goal is to maintain these Felds e±ciently (in O (log n ) time) as the tree is updated. Explain how you would attempt doing this using the GAT. 4. Show how you would use an order-statistic tree (as a black-box) to count the number of inversions
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: in a set of real numbers. (See the text for the deFniton of an inversion.) The target time bound is O ( n log n ) for n reals. 5. Let G be a connected, undirected, edge-weighted graph. Prove that G has a unique MST if all the edge weights are distinct. Note: One way to prove this is to observe how Kruskal’s algorithm would operate on this graph. A more instructive way is to prove this result “non-algorithmically”, by using the notion of a cut. 6. Assume that you are given a set P = { p 1 < p 2 < · · · < p n } of points on the real line; the distance between consecutive points can be arbitrary. We would like to determine the smallest number of closed intervals, each of length 1, to place on the real line so that each point of P is contained in some interval. Describe brie²y a greedy algorithm for this problem and prove it correct via the two-step method. A clear, well-articulated proof is expected....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online