Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(graph/topo.md): 将伪代码改为中文 #5458

Closed
wants to merge 2 commits into from

Conversation

consider68
Copy link

@consider68 consider68 commented Mar 17, 2024

将伪代码改为中文

  • 我已认真阅读贡献指南 (contributing guidelines) 和社区公约 (code of conduct),并遵循了如何参与页及格式手册页的相应规范。

将伪代码改为中文
Copy link

welcome bot commented Mar 17, 2024

感谢你对 OI Wiki 的关注!记得检查是否遵守了格式规范,听说和项目风格统一的 Pull Request 会更容易被 Merge~

@HeRaNO HeRaNO changed the title Update topo.md feat(graph/topo.md): 将伪代码改为中文 Mar 17, 2024
@Great-designer
Copy link
Contributor

很好。伪代码修改有若干方向:

  1. 改成中文,有利于中文读者。
  2. 改成可运行的正式编程语言代码,方便入门的编程苦手。
  3. 上述二者的结合,改成的中文可以作为正式代码的注释。

@@ -95,23 +95,21 @@ $$

不断重复以上过程,直到集合 $S$ 为空。检查图中是否存在任何边,如果有,那么这个图一定有环路,否则返回 $L$,$L$ 中顶点的顺序就是构造拓扑序列的结果。

首先看来自 [Wikipedia](https://en.wikipedia.org/wiki/Topological_sorting#Kahn's_algorithm) 的伪代码
首先看来自 [Wikipedia](https://zh.wikipedia.org/wiki/%E6%8B%93%E6%92%B2%E6%8E%92%E5%BA%8F) 的伪代码
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

链接不要换,因为 Wikipedia 那边同一个页面不同语言的版本可能有较大差异。

Comment on lines -104 to -110
while S is not empty do
remove a node n from S
insert n into L
for each node m with an edge e from n to m do
remove edge e from the graph
if m has no other incoming edges then
insert m into S
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whilefor 建议保留

Copy link

github-actions bot commented May 5, 2024

你好 👋

这个 Pull Request 已经 30 天未响应。
如果此 PR 在将来的 14 天内仍未恢复活动,它将被关闭。

感谢理解与支持。

@github-actions github-actions bot added the No Response / 失去响应 该 Pull Request 已经失去响应 label May 5, 2024
@github-actions github-actions bot closed this May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants