sailing

Everything...

2007年2月22日

Words I like found while I'm reading a book

摘要: Blazing trails can be exciting, but when your goal is producing reliable code, it's often best to let others do thebushwhacking for you. 阅读全文

posted @ 2007-02-22 01:09 乌生鱼汤 阅读(140) 评论(1) 推荐(0) 编辑

2007年2月9日

傻傻得看两个函数谁大,理解错了一段文字,走了很多弯路,还好最后终于理解了。

摘要: #include "stdafx.h" #include #include using namespace std; double quicklog(__in double base, __in double value); int _tmain(int argc, _TCHAR* argv[]) { double n = 100000000; cout... 阅读全文

posted @ 2007-02-09 02:59 乌生鱼汤 阅读(242) 评论(0) 推荐(0) 编辑

2007年2月8日

recursion tree solution

摘要: In a recursion tree, each node represents teh cost of a single subproblem somewhere in the set of recursive function invocations. We sum the costs within each level of the tree to obtain a set of per-... 阅读全文

posted @ 2007-02-08 23:57 乌生鱼汤 阅读(215) 评论(0) 推荐(0) 编辑

2007年2月6日

两维和三维世界

摘要: 在两维世界里面很难想象三维世界里面的样子以前很难理解这句话最近看到一个问题:对任何两个实数,总是存在如下的比较结果:ab但是对于近似函数(asymptotic function),这可不一定比如f(n)=n and n2sin(n)为什么会这样呢?原来是当对函数进行渐近比较的时候,被比较对象的函数多了一个变化因子n,这在比较常数的时候是没有的。可以认为常数的变化因子是0,函数的变化因子是1。... 阅读全文

posted @ 2007-02-06 22:23 乌生鱼汤 阅读(224) 评论(0) 推荐(0) 编辑

2007年2月4日

Recursive version of the insertion sort

摘要: // RecursiveInsertionSort.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include using namespace std; void PrintArray(int a[], int iStart, int iEnd); void Inse... 阅读全文

posted @ 2007-02-04 20:49 乌生鱼汤 阅读(198) 评论(0) 推荐(0) 编辑

Numeric test, find the solution of non-polynomial equation, play

摘要: #include #include using namespace std; class Utility { public: int static Left(int n) { return 8*n*n; } int static Right(int n) { return (int)64*n*log((double... 阅读全文

posted @ 2007-02-04 00:36 乌生鱼汤 阅读(188) 评论(0) 推荐(0) 编辑

2007年1月29日

Merge Sort

摘要: // MergeSort.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include void MergeSort(int* a, int iLen); void MergePass(int* a, int* aa, int subLength, int iLen);... 阅读全文

posted @ 2007-01-29 01:11 乌生鱼汤 阅读(200) 评论(0) 推荐(0) 编辑

Heap Sort

摘要: // HeapSort.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include void DirectSelectSort(int* a, int iLen); void HeapSort(int* a, int iLen); void FilterDown(in... 阅读全文

posted @ 2007-01-29 00:10 乌生鱼汤 阅读(196) 评论(0) 推荐(0) 编辑

2007年1月28日

Direct Selection Sort

摘要: #include "stdafx.h" #include void DirectSelectSort(int* a, int iLen); void Swap(int* a, int index1, int index2); void PrintArray(int a[], int iLen); int _tmain(int argc, _TCHAR* argv[]) { int... 阅读全文

posted @ 2007-01-28 23:10 乌生鱼汤 阅读(201) 评论(0) 推荐(0) 编辑

Quick sort

摘要: // QuickSort.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include void QuickSortStart(int* a, int iLen); void QuickSort(int* a, int startIndex, int endIndex)... 阅读全文

posted @ 2007-01-28 22:56 乌生鱼汤 阅读(191) 评论(0) 推荐(0) 编辑

导航