问题描述:
Give a divide and conquer algorithm for the following problem:
you are given two sorted lists of size m and n, and are allowed
unit time access to the ith element of each list. Give an O(lg m + lgn)
time algorithm for computing the kth largest element in the union of the two lists. (For simplicity, you can assume that the elements of the
two lists are distinct).
问题分析:
1. 把 A 平均分为前后两个部分,前部分有 x 个元素,后部分有 n-x 个元素
(由于 A 是有序的,所以后一部分的所有元素大于前一部分)。A[x] = A的
后一部分的第一个元素。