自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(14)
  • 收藏
  • 关注

原创 !!!Chapter 10 Algorithm Design Techniques

10.1 Greedy AlgorithmsThere are three greedy algorithms in chapter 9: Dijkstra's, Prim's, and Kruskal's algorithms.In greedy algorithms, in each phase, a decision is made that appears to be good,

2013-05-31 21:53:14 915

原创 !!!Chapter 9 Graph Algorithm (9.4 ~ 9.7) Network Flow

9.4 Network Flow ProblemsSuppose we are given a directed graph G = (V, E) with edge capacities Cv,w. We have two vertices: s, which we call the source, and t, which is the sink. Through any edge(v,w

2013-05-30 11:22:38 523

原创 !!!Obj-C 2.0 -- Chapter 6 Protocols

Protocols declare methods that can be implemented by any class.6.1 Declaring Interfaces for Others to ImplementInformal and formal protocols declare methods that are independent of any specific cl

2013-05-21 04:17:28 645

原创 !!!float/double在内存中的表示

C语言中float,double类型,在内存中的结构(存储方式)从存储结构和算法上来讲,double和float是一样的,不一样的地方仅仅是float是32位的,double是64位的,所以double能存储更高的精度。任何数据在内存中都是以二进制(0或1)顺序存储的,每一个1或0被称为1位,而在x86CPU上一个字节是8位。比如一个16位(2 字节)的short int型变量的值是100

2013-05-20 09:20:20 1112

原创 !!!Table of Content

Review 1Chapter 1. Getting Started      11.1 Writing a Simple C++ Program    21.2 A First Look at Input/Output     5 1.3 A Word About Comments     101.4 Control Structures     11 1.5 Int

2013-05-19 23:12:48 569

原创 !!!Chapter 9 Graph Algorithm (9.1 ~ 9.3) Topological Sort/Shortest-Path

9.1 DefinitionBasic Component: A graph G = (V, E) consists of a set of vertices(顶点), V, and a set of edges, E. Each edgeis a pair (v, w), where v,w ∈ V。 Edges are sometimes referred to as arcs

2013-05-18 11:01:13 2738

原创 !!!Obj-C 2.0 -- Chapter 5 Categories and Extensions

A category allows you to add methods to an existing class -- even to one to which you don't have the source.5.1 Adding Methods to ClassesYou can add methods to a class by declaring them in an inte

2013-05-17 03:42:24 1313

原创 !!!Chapter 8 The Disjoint Set ADT

Disjoint Set: 不相交集,并查集8.1 Equivalence RelationsA relation R is defined on a set S if for every pair of elements (a, b), a, b ∈ S, a R b is either true or false. If a R b is true, then we say tha

2013-05-14 23:10:35 2253

转载 !!!博弈论基础: 巴什博奕+威佐夫博奕+尼姆博弈

(一)巴什博奕(Bash Game):只有一堆n个物品,两个人轮流从这堆物品中取物,规定每次至少取一个,最多取m个.最后取光者得胜.若(m+1) | n,则先手必败,否则先手必胜。显然,如果n=m+1,那么由于一次最多只能取m个,所以,无论先取者拿走多少个,后取者都能够一次拿走剩余的物品,后者取胜.因此我们发现了如何取胜的法则:如果n=(m+1)r+s,(r为任意自然数,s≤m),那么

2013-05-14 07:06:14 781

原创 !!!Obj-C 2.0 -- Chapter 4 Declared Properties

4.2 Property Declaration and ImplementationThere are two parts to a declared property, its declaration and its implementation4.2.1 Property DeclarationA property declaration begins with the ke

2013-05-13 07:01:50 623

原创 KNOW: rand() function & Card Shuffle Algorithm

计算机的随机数都是由伪随机数,即是由小M多项式序列生成的,其中产生每个小序列都有一个初始值,即随机种子。(注意: 小M多项式序列的周期是65535,即每次利用一个随机种子生成的随机数的周期是65535,当你取得65535个随机数后它们又重复出现了。)我们知道rand()函数可以用来产生随机数,但是这不是真正意义上的随机数,是一个伪随机数,是根据一个数(我们可以称它为种子)为基准以某个递推公

2013-05-09 03:54:41 964

原创 !!!Chapter 7 Sorting

7.2 Insertion Sortvoid InsertionSort( ElementType A[], int N ){ int j,p; ElementType Tmp; for( p = 1; p < N; p++ ) { Tmp = A[p]; // we compare A[j] & A[j-1], so j>

2013-05-05 22:50:20 1224

原创 !!!Obj-C 2.0 -- Chapter 3 Allocating and Initializing Objects

3.1 Allocating and Initializing ObjectsIt takes two steps to create an object using Objective-C:1. Dynamically allocate memory for the new object2. Initialize the newly allocated memory to appro

2013-05-05 00:50:53 668

原创 !!!Obj-C 2.0 -- Chapter 2 Defining a Class

In Objective-C, classes are defined in two parts:An interface that declares the methods and instance variables of the class and names its superclass.An implementation that actually defines the cla

2013-05-02 21:51:18 798

空空如也

空空如也

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

TA关注的人

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