O(1) 的小乐
豆瓣账号:http://www.douban.com/people/sosisarah/
摘要: 今天早上在Quora上看到的一个题目,很不错的!最直观的是枚举n^3,但稍微进步一点的观察是找出3个数,然后最大的减去最小的2倍的结果,然后就有了线性扫一遍就OK。 Given three arrays, A, B, and C, what is the best algorithm to find the minimum value of , where ? 解答: Assuming that ... 阅读全文
posted @ 2014-04-18 13:13 O(1)的小乐 阅读(281) 评论(2) 推荐(0) 编辑