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: 最小生成树:add Boruvka 算法 #1592

Merged
merged 21 commits into from Aug 24, 2019
Merged

feat: 最小生成树:add Boruvka 算法 #1592

merged 21 commits into from Aug 24, 2019

Conversation

sshwy
Copy link
Member

@sshwy sshwy commented Aug 21, 2019

closes #1339

顺便,我觉得可以找时间声名一下伪代码的写法。。。个个声称伪代码写出来C++

改了一下代码的缩进

对于使用 ???note的格式,建议先空一行再缩进写note里的内容。这样typora就会把note里的内容当成代码。不然就会在奇怪的地方加三个反引号导致bug


审核的同学 请着重关注以下四方面:

  1. 注意有没有 typo
  2. 不论你是否熟悉相关知识,都请以初学者的角度把这个 PR 的内容阅读一遍,跟着作者的思路走,然后谈谈你的感受
  3. 如果你熟悉相关知识,请按照自己的理解评估这个 PR 的内容是否合适
  4. 尽量保持跟进直到它被 merge 或 close

@Ir1d
Copy link
Member

Ir1d commented Aug 21, 2019

空一行的话不过 lint bot,我当时给写死了只识别有四个空格的行.. 同理莫名其妙 lint 出来的反引号可能是由于中间空行没有前缀空格..

@Enter-tainer
Copy link
Member

同好奇伪代码怎么写,看 paper 里写的五花八门,用了一万种字体

@sshwy
Copy link
Member Author

sshwy commented Aug 21, 2019

@Enter-tainer 1. 变量名用英文表示,省略声名与类型。
2. 结构语句使用多数编程语言通用的 if、while、for语句
3. 程序块用缩进表示,不使用“{}”
4. 使用C/C++语言的运算符,比如赋值运算=,判等==,判不等!=。逻辑运算符用 ||代表逻辑或,&&代表逻辑与,!代表非
5. 数组A的长度用A.length表示
6. 数组A的第i项元素用A[i]表示
7. 数组下标视情况分别使用0起点和1起点
——摘自《挑战程序设计竞赛2》

@Ir1d
Copy link
Member

Ir1d commented Aug 21, 2019

这组规范看着和 cpp 没啥大差别的样子?

@Enter-tainer
Copy link
Member

@Ir1d 我见过的伪代码,单表示赋值,就有五花八门的方法,:= <- 啥的。还有字体的变化,比如用 \textsc 表示函数名,\textit 表示变量名 ,无衬线体表示类型...总之挺头晕的

@sshwy
Copy link
Member Author

sshwy commented Aug 21, 2019

@Ir1d 的确。但是,其实只要你能把 for(i=1;i<=n;i++)之类的写成 for i from 1 to n: 就很伪代码了 😂

@sshwy
Copy link
Member Author

sshwy commented Aug 21, 2019

空一行的话不过 lint bot,我当时给写死了只识别有四个空格的行.. 同理莫名其妙 lint 出来的反引号可能是由于中间空行没有前缀空格..

所以typora和你家bot同源(确信

@ouuan
Copy link
Member

ouuan commented Aug 21, 2019

伪代码我来写好了..你们看看你们要不要写一写朴素 Prim,堆优化 Prim 需不需要保留。

@sshwy
Copy link
Member Author

sshwy commented Aug 21, 2019

@ouuan 都保留吧

docs/graph/mst.md Outdated Show resolved Hide resolved
docs/graph/mst.md Outdated Show resolved Hide resolved
@@ -235,11 +270,10 @@ for (i = 1; i <= n; i++) {

Kruskal 算法中的「集合」,能否进一步优化?
Copy link
Member

Choose a reason for hiding this comment

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

这个不是并查集的问题吗..怎么在 MST 讨论啊。

Copy link
Member Author

Choose a reason for hiding this comment

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

不是我写的,您给润色润色QAQ

@Ir1d Ir1d merged commit a67ff93 into OI-wiki:master Aug 24, 2019
@Ir1d Ir1d mentioned this pull request Aug 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add Boruvka (in MST)
6 participants