blog正式转移到了这里:

http://blog.phoeagon.cz.cc



I know

phoeagon啲01世界

2009 年 10 月 2 日  星期五   晴天


[ Technical ] En Book 學習 分類: Programming Impossib...

En Book 學習


最近在看一些EN的pdf~

學習一下~

Algorithm Design Manual: 

(S.S. Skiena, The Algorithm Design Manual, 2nd ed)

 首先,關於 快速排序~

1、隨機化排列。

2. 三點取樣~

3. 小的數列留給選擇排序~

4、(最囧了~)先做小區間的快排~?(據說能減少棧空間的利用~ 太扯了~)


第二,有關二分圖染色,是這麼介紹的:

[Application of Breadth First Search.]


A graph is bipartite if it can be colored without conflicts while using only two
colors. Bipartite graphs are important because they arise naturally in many appli-
cations. Consider the "had-sex-with" graph in a heterosexual world. Men have sex
only with women, and vice versa.
Thus, gender defines a legal two-coloring, in this
simple model.

... ...

最後作者不忘再幽默一回~

We can assign the first vertex in any connected component to be whatever
color/sex we wish. BFS can separate the men from the women, but we can't tell
them apart just by using the graph structure
.


那本書比較重視建模(modelling)吧。有一個section叫“Design Graphs, Not Algorithms”。

圖論部份作者是這樣分類的:

Polynomial time:

Connected Components

Topological Sorting

Minimum Spanning Tree

Shortest Path

Transitive Closure

Matching

Eulerian Cycle/ E. Tour/ Chinese Postman

Edge and Vertex Connectivity

Network Flow

(3 more topics excluded here)


Hard Problems (NP)

Clique

Independent Set

Vertex Cover

Traveling Salesman Problem

Hamiltonian Cycly

Graph Cycle

Graph Partition

Vertex Coloring

Edge Coloring

Graph Isomophism (同構)

Steiner Tree ( a spanning tree connecting a given set of  points, with at most k extra points added to obtain the minimum cost )


至於Introduction to Algorithms,我看過才知道,原來我的快排 Quicksort 寫得不夠標準~

CLRS建議道,in a hash function like this:

h(x)=x mod m

A prime not too close to an exact power of 2 is often a good choice for m.






訪客留言 (返回 phoeagon 的日誌)

訪客名稱:
電郵地址: (不會公開)
驗證碼:  按此更新驗證碼 (如看不清楚驗證碼請點擊圖片刷新)
俏俏話: (必需 登入 後才能使用此功能)
[ 開啟多功能編輯器 ]







人氣:79400
暱稱: phoeagon
性別: 男
MORE...  
« February 2019 »
SMTWTFS
12
3456789
10111213141516
17181920212223
2425262728
» 最新日誌
Blog Moved!
跨站jsMath实现
路由表是个好东西
Twitter Fav列表达陈100...
搞定了公式显示
» 日誌分類
全部 (175)
Code Storage (11)
Math&Phy@Chem@MM (8)
Music Anyway (5)
Programming Impossible (28)
RSS提示 (2)
StorageBox (5)
'Bout Here (12)
滑鼠人生 (42)
碎屑 (51)
未分類 (11)
» 訪客留言
http://clean... (xuotfenugvyz)
http://polll... (fzxzwtiooaqj)
Фильмы... (EqSo.obum)
Фильмы... (DfKz.wmnu)
Фильмы... (FiWo.snbd)
» 最近訪客
最近沒有訪客
» 每月文章
» 日誌訂閱
尚未訂閱任何日誌
» 我的好友
» 我的連結
Ink Mark --Jlim
StarKirby
|S||S||S|
「流年祭」
» 日誌統計
文章總數: 175
留言總數: 86
今日人氣: 170
累積人氣: 79400
» 站內搜索
RSS Feed