CSC 7300 Fall 2011
Homework 2
due date 9/26/11, in class, 120 points
1. We are given a set of n pairs bolts and nuts in a box. Each pair is of dierent size than
others. So for each nut there is exactly one tting bolt. But they are all mixed up so we
donot
CSC 7300 Fall 2011
Homework 3
due date 10/10/11, in class, 100 points
1. Consider a data structure S supporting two operations: insert(S, x) and extract low(S ).
Here, extract low returns(and removes) any number y such that y is smaller than the current
m
CSE373 Homework 2 Solutions & Hints
In this solution, we assume that the input is S[1.n] if theres no specification about the form of
the input with a size n.
We also assume that Sort(S, i, j, i) will sort S[i], S*i+1+, , S[j] in an increasing order in th
CSCI 570 Homework #3 Solution
Prof. Ming-Deh Huang TAs: Iftikhar Burhanuddin, Chansook Lim 09/27/03 Gauss, Karl Friedrich (1777-1855) It is not knowledge, but the act of learning, not possession but the act of getting there, which grants the greatest enjo
Medians and Order Statistics
CLRSChapter9
1
The k-th order statistic is the k-th smallest element of an array.
3
4 13 14 23 27 41 54 65 75
8th order statistic
n
2
The lower median is the
-th order statistic
n
The upper median is the 2 -th order statistic