CMPT 307 — Data Structures and Algorithms Exercises on Heaps and Stable Matchings. Due: Thursday, Septem-ber 24th (at the beginning of the class) Reminder: the work you submit must be your own. Any collaboration and consulting outside resourses must be explicitely mentioned on your submission. 1. Describe a Θ( n log n ) time algorithm that, given a set S of n integers and another integer x , determines whether or not there exist two elements in S whose sum is exactly x . 2. Suppose that in the MergeSort algorithm the input sequence split into k subsequences ( k > 2, but ﬁxed). Determine the running time of such algorithm. Does it have any advantages comparing to the standard MergeSort? (You may wish to look into Chapter 4 of CLR.) 3. We explore the issue of truthfulness in the Stable Matching problem and speciﬁcally in the Gale-Shapley algorithm. The basic question is: Can a man or a woman end up better oﬀ lying about his or her preferences? More concretely, we suppose each participant has a true
This is the end of the preview. Sign up
access the rest of the document.