摘要: Question:Given intergers A1,A2,…,An,find the maximum Subsequence Sum ProblemSolution:有很多方法可以解决这个问题。下面我只给出我认为最好的算法。 1 //linear-time maximum contiguous ... 阅读全文
posted @ 2014-04-16 09:10 猫了个妖喵 阅读(132) 评论(0) 推荐(0) 编辑
摘要: Question:computing the greatest common divisorSolution: 1 template 2 T gcd(T m,T n) 3 { 4 if(m<n) 5 { 6 T temp = a; 7 a=b;... 阅读全文
posted @ 2014-04-16 09:05 猫了个妖喵 阅读(85) 评论(0) 推荐(0) 编辑