mirror of
https://github.com/krahets/hello-algo.git
synced 2026-04-13 18:00:18 +08:00
Update the book based on the revised second edition (#1014)
* Revised the book * Update the book with the second revised edition * Revise base on the manuscript of the first edition
This commit is contained in:
@@ -30,7 +30,7 @@ $$
|
||||
|
||||

|
||||
|
||||
我们还可以为边添加“权重”变量,从而得到如下图所示的「有权图 weighted graph」。例如在“王者荣耀”等手游中,系统会根据共同游戏时间来计算玩家之间的“亲密度”,这种亲密度网络就可以用有权图来表示。
|
||||
我们还可以为边添加“权重”变量,从而得到如下图所示的「有权图 weighted graph」。例如在《王者荣耀》等手游中,系统会根据共同游戏时间来计算玩家之间的“亲密度”,这种亲密度网络就可以用有权图来表示。
|
||||
|
||||

|
||||
|
||||
@@ -70,7 +70,7 @@ $$
|
||||
|
||||
观察上图,**邻接表结构与哈希表中的“链式地址”非常相似,因此我们也可以采用类似的方法来优化效率**。比如当链表较长时,可以将链表转化为 AVL 树或红黑树,从而将时间效率从 $O(n)$ 优化至 $O(\log n)$ ;还可以把链表转换为哈希表,从而将时间复杂度降至 $O(1)$ 。
|
||||
|
||||
## 图常见应用
|
||||
## 图的常见应用
|
||||
|
||||
如下表所示,许多现实系统可以用图来建模,相应的问题也可以约化为图计算问题。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user