Fuuuuuji
95214b144c
Update graph_adjacency_matrix.py
...
理解K神这个实现主要是为了演示邻接矩阵的基本原理,但在实际使用中可能会遇到一些限制:在实际应用中,通常使用顶点的值而不是索引来操作图。所以,为了更“公平”地与邻接表方法的对比,进行了改进:
1. 引入 vertex_map:使用字典 vertex_map 来存储顶点值到索引的映射。
2. 基于值的操作:add_vertex, remove_vertex, add_edge, 和 remove_edge 方法现在都使用顶点值而不是索引。这使得图的操作更加直观和用户友好。
3. 动态索引管理:在 remove_vertex 方法中,更新了剩余顶点的索引映射。这确保了在删除顶点后,其他顶点的索引仍然保持正确。
2024-07-26 21:26:57 +08:00
Yudong Jin
cfc273783b
feat: Add glossary and description for "哈希集合" ( #1310 )
2024-04-28 22:00:25 +08:00
Yudong Jin
a005c6ebd3
Some improvements ( #1073 )
...
* Update avatar's link in the landing page
* Bug fixes
* Move assets folder from overrides to docs
* Reduce figures' corner radius
* Update copyright
* Update header image
* Krahets -> krahets
* Update the landing page
2024-02-07 22:21:18 +08:00
Yudong Jin
f68bbb0d59
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
2023-12-28 18:06:09 +08:00
Yudong Jin
e720aa2d24
feat: Revised the book ( #978 )
...
* Sync recent changes to the revised Word.
* Revised the preface chapter
* Revised the introduction chapter
* Revised the computation complexity chapter
* Revised the chapter data structure
* Revised the chapter array and linked list
* Revised the chapter stack and queue
* Revised the chapter hashing
* Revised the chapter tree
* Revised the chapter heap
* Revised the chapter graph
* Revised the chapter searching
* Reivised the sorting chapter
* Revised the divide and conquer chapter
* Revised the chapter backtacking
* Revised the DP chapter
* Revised the greedy chapter
* Revised the appendix chapter
* Revised the preface chapter doubly
* Revised the figures
2023-12-02 06:21:34 +08:00
krahets
db5d1d21f3
Several bug fixes.
2023-10-29 00:09:54 +08:00
krahets
5aacf2dfe0
Improve Python code for importing modules.
2023-10-19 16:21:51 +08:00
krahets
9f59c572b5
fine tune
2023-09-17 01:13:15 +08:00
krahets
90af225dae
Remove -> None for Python functions
2023-07-24 22:34:05 +08:00
krahets
c68f18e480
Finetune
2023-07-19 01:45:14 +08:00
krahets
e196962d0a
Simplify the declarations of the Python code.
2023-05-22 22:03:57 +08:00
krahets
3590262c7e
Modify the exception handling in Java and Python.
2023-04-23 03:41:39 +08:00
krahets
0bec52d7cc
Polish the chapter of heap, introduction, preface.
...
Replace "其它" with "其他"
2023-04-09 19:12:37 +08:00
krahets
10e2180013
Unify the comment style of python codes
2023-04-09 05:30:02 +08:00
Yudong Jin
5ddcb60825
Format python codes with black. ( #453 )
2023-04-09 05:05:35 +08:00
Yudong Jin
8918ec9079
refactor: Follow the PEP 585 Typing standard ( #439 )
...
* Follow the PEP 585 Typing standard
* Update list.py
2023-03-23 18:51:56 +08:00
Yudong Jin
9151eaf533
Add typing annotations to Python codes. ( #411 )
2023-03-12 18:49:52 +08:00
krahets
7c501140f0
Update code style for Python
2023-03-03 03:07:22 +08:00
zhuoqinyue
037aaeeaa2
fix: update the code comment ( #386 )
...
Co-authored-by: steak-zhuo <zhuoqinyue@gmail.com>
2023-02-26 01:16:41 +08:00
krahets
adbb12c011
Fix a comment in graph_adjacency_list
2023-02-23 20:32:26 +08:00
krahets
73c8920c6b
Add python code of Heap and Graph to docs.
2023-02-23 20:23:49 +08:00
Yudong Jin
1f4dba4845
Add the Python codes for the chapter of Graph and Heap ( #382 )
2023-02-23 20:00:40 +08:00