摘要:
问题就是找两个排序数组里面第k大的数我们在A,B前k/2里面,比较A[k/2] , B[k/2]哪个小说明第k个肯定不在里面,可以抛弃,然后继续递归处理class Solution {public: /** * choice k/2 from a, and k/2 from b * compare the last * if b[k/2] > a[k/2], drop a[k/2], kth must not in a[k/2] * otherwise the same */ double findMedianSortedArrays(int A[],... 阅读全文
posted @ 2014-01-22 23:03 1957 阅读(273) 评论(0) 推荐(0)
浙公网安备 33010602011771号