![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
algorithm
godleft90
这个作者很懒,什么都没留下…
展开
-
4Sum
问题描述: 解决思路: 算法1:O(n^3) 我们可以仿照3sum的解决方法。这里枚举第一个和第二个数,然后对余下数的求2sum,算法复杂度为O(n^3) class Solution { public: vector > fourSum(vector &num, int target) { int n = num.size();原创 2015-01-16 16:51:39 · 298 阅读 · 0 评论 -
3Sum Closest
问题描述: Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would hav原创 2015-01-16 16:25:08 · 247 阅读 · 0 评论 -
PageRank算法简介及Map-Reduce实现
PageRank对网页排名的算法,曾是Google发家致富的法宝。以前虽然有实验过,但理解还是不透彻,这几天又看了一下,这里总结一下PageRank算法的基本原理。 一、什么是pagerank PageRank的Page可是认为是网页,表示网页排名,也可以认为是Larry Page(google 产品经理),因为他是这个算法的发明者之一,还是google CEO(^_^)。PageRa转载 2015-03-16 19:44:35 · 1019 阅读 · 0 评论