UMBC CMSC441, Design & Analysis of Algorithms, Fall 1999, Section 0101
Homework Assignments 5-6
The following homework problems have been assigned for Section 0101 of CMSC441.
Homework 5, Due Thursday October 14
Exercise 10.3-8, page 192.
Exercise 10.3-9, page 192.
The optimal location is at the median of the y-coordinates of the oil
wells. Prove why.
Given a (not necessarily sorted) sequence S = {k1,
k2, ..., kn} of n arbitrary numbers. Consider the
collection C of n2 numbers of the form: min{ki, kj}, for
1 <= i, j <= n. Present an O(n)-time and O(n)-space algorithm to find
the median of C.
Homework 6, Due Thursday October 21
Exercise 14.2-5, page 267.
Problem 14-2, pages 278-279.
Given an array A of n elements, and an array B of m elements, how
would you find A intersect B? Report your running time in terms of n and m.