自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Aegeaner的专栏

in every possible way

  • 博客(8)
  • 资源 (9)
  • 收藏
  • 关注

原创 回转顺序打印矩阵的改进算法

原题目见:http://blog.csdn.net/aegeaner/article/details/6744011如果使用二维数组,空间复杂度为O(N^2),事实上本题可以计算A[i][j]的通项公式,这样可以不用额外的矩阵存储空间,空间复杂度降为O(1)。思想是考虑从左上角开始的i*i子矩阵,只要在子矩阵扩张的外围补充(i*i+1)~(i+1)*(i+1)的序列即可。又可以看做是(i+

2012-04-26 18:20:58 1431

原创 C++仿函数

根据SGI官方文档,仿函数也叫函数对象(Function Object, or Functor),定义就是任何可以像函数一样被调用的对象。一个普通的函数是函数对象,一个函数指针当然也是,广义上说任何定义了operator()的类对象都可以看作是函数对象。最基本的函数对象概念包括Generator, Unary Function(一元函数), 和Binary Function(二元函数),分

2012-04-20 19:34:49 7373 1

原创 【动态规划】每对顶点之间的最短路径之Floyd-Warshall算法

《算法导论》25.2. 《计算机算法(C++版)》5.3.当然这个算法的实现是相当简单的,只使用了三重循环,时间复杂度为O(n^3)。但是重点是算法背后的思想,一般教材都把这个算法当做典型的图算法来讲,却没有讲到背后动态规划的思想。不过《计算机算法(C++版)》做到了这一点。此题的最优子结构很明显,假设i到j的最短路径是d,那么明显对路径上的任一点k,有d、d都是最短路径。但是这样的子问题很难

2012-04-13 17:02:21 2728 1

原创 一道腾讯笔试题的思路

受到w397090770博文的启发,写一下此题的思路(原文只有代码)。原博文地址:http://blog.csdn.net/w397090770/article/details/7449309已知数组a[n],求数组b[n].要求:b[i]=a[0]*a[1]*……*a[n-1]/a[i],不能用除法。 a.时间复杂度O(n),空间复杂度O(1)。 b.除了迭代器i,不允许使用任何其它

2012-04-13 14:01:48 1134

原创 【动态规划】多部图问题代码

《计算机算法(C++版)》5.2.用前向算法和后向算法进行动态规划,前向算法从后往前递推;后向算法,从前往后递推。C++代码如下:#include #include #include using namespace std;class Graph{private: const static int MAXSIZE = 101; int VertexNum; in

2012-04-12 21:32:36 1310

原创 【动态规划】最长递增子序列代码(UVA 10131)

题目:http://uva.onlinejudge.org/index.php?option=onlinejudge&Itemid=8&page=show_problem&problem=1072先按大象的体重排序,然后用DP求出大象IQ的最长递减子序列。为了输出这个子序列,每次子序列扩容时使用一个Pre[]数组保存前一个元素的索引,将索引压栈后正序输出。#include #incl

2012-04-11 22:05:16 1319

原创 【动态规划】矩阵链乘法代码

CLRS 15.2#include #include #include int m[101][101];int s[101][101];void matrix_chain_order(int p[], int n){ for(int i=1; i<=n; i++) m[i][i] = 0; for(int l=2; l<=n; l++)

2012-04-11 16:53:54 1133

原创 【动态规划】装配线调度代码

CLRS第二版15.1:#include int f[2][101];int l[2][101];int ff;int ll;void fastest_way(int n, int a[2][n], int t[2][n-1], int e[2], int x[2]){ f[0][0] = a[0][0] + e[0]; f[1][0] = a[1][0]

2012-04-11 13:45:21 980

The Architecture of Open Source Applications

讲开源软件架构的书。 Contents Introduction Amy Brown and Greg Wilson ix 1. Asterisk Russell Bryant 1 2. Audacity James Crook 15 3. The Bourne-Again Shell Chet Ramey 29 4. Berkeley DB Margo Seltzer and Keith Bostic 45 5. CMake Bill Hoffman and Kenneth Martin 67 6. Eclipse Kim Moir 77 7. Graphite Chris Davis 101 8. The Hadoop Distributed File System Robert Chansler, Hairong Kuang, Sanjay Radia, Konstantin Shvachko, and Suresh Srinivas 111 9. Continuous Integration C. Titus Brown and Rosangela Canino-Koning 125 10. Jitsi Emil Ivov 139 11. LLVM Chris Lattner 155 12. Mercurial Dirkjan Ochtman 171 13. The NoSQL Ecosystem Adam Marcus 185 14. Python Packaging Tarek Ziadé 205 15. Riak and Erlang/OTP Francesco Cesarini, Andy Gross, and Justin Sheehy 229 16. Selenium WebDriver Simon Stewart 245 17. Sendmail Eric Allman 271 18. SnowFlock Roy Bryant and Andrés Lagar-Cavilla 291 19. SocialCalc Audrey Tang 303 20. Telepathy Danielle Madeley 325 21. Thousand Parsec Alan Laudicina and Aaron Mavrinac 345 22. Violet Cay Horstmann 361 23. VisTrails Juliana Freire, David Koop, Emanuele Santos, Carlos Scheidegger, Claudio Silva, and Huy T. Vo 377 24. VTK Berk Geveci and Will Schroeder 395 25. Battle For Wesnoth Richard Shimooka and David White 411 Bibliography Making Software

2011-09-17

高精度计算源码

强大的hugecalc!

2007-08-30

Learning the Unix OS

(ebook-chm) O'Reilly Learning the Unix OS

2007-08-30

Inside C++ Object Model

经典..Inside C++ Object Model

2007-08-30

Effective C++(中文版)

经典经典经典经典经典

2007-08-30

C++高级参考手册

C++高级参考手册C++高级参考手册

2007-05-24

C++标准库,Boost简介

Addison.Wesley.Beyond.the.C.plus.plus.Standard.Library.An.Introduction.to.Boost

2007-05-20

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除