An m ? n array A of real numbers is a Monge array if for all i,

Question:

An m ? n array A of real numbers is a Monge array if for all i, j, k, and l such that 1 ? i

image

In other words, whenever we pick two rows and two columns of a Monge array and consider the four elements at the intersections of the rows and the columns, the sum of the upper-left and lower-right elements is less than or equal to the sum of the lower-left and upper-right elements. For example, the following array is Monge:

image

a. Prove that an array is Monge if and only if for all i = 1, 2, ?., m - 1 and j = 1, 2, ?, n - 1, we have

image

b. The following array is not Monge. Change one element in order to make it Monge. Use part (a).

?image

c. Let f (i) be the index of the column containing the leftmost minimum element of row i. Prove that f (1) ? f (2) ? ? ? f (m) for any m ? n Monge array.

d. Here is a description of a divide-and-conquer algorithm that computes the leftmost minimum element in each row of an m ? n Monge array A:?

Construct a submatrix A? of A consisting of the even-numbered rows of A. Recursively determine the leftmost minimum for each row of A?. Then compute the leftmost minimum in the odd-numbered rows of A.?

Explain how to compute the leftmost minimum in the odd-numbered rows of A. given that the leftmost minimum of the even-numbered rows is known) in O(m + n) time.

e. Write the recurrence describing the running time of the algorithm described in part (d). Show that its solution is O(m + n log m).

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  answer-question

Introduction to Algorithms

ISBN: 978-0262033848

3rd edition

Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest

Question Posted: