2013年7月2日
摘要: 题目:There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). 刚开始的时候理解有误,以为是求中位数。其实不是。这里所谓的"median of the two sorted arrays"指的是:如果A.length + B.length 是奇数,返回merge后中间的那个数;如果是偶数,返回中间两个数的平均 阅读全文
posted @ 2013-07-02 15:31 lichen782 阅读(2496) 评论(0) 推荐(0) 编辑