正文
增加 3 行删除 1 行
8 行未改动910111213141516178 行未改动那么时间复杂度为 $\Omicron(L+nB\log_BL+L\log_BL)$。考虑取 $B=\frac{L}{n}$,那么复杂度为 $\Omicron(L+\frac{L\log L}{\log L-\log n})=\Omicron(\frac{2L\log L-L\log n}{\log L-\log n})=\Omicron(\frac{L\log L-L\log n}{\log L-\log n })=\Omicron(L)$。这样我们就做到线性了。## 代码稍后补。8 行未改动9101112131415161718198 行未改动那么时间复杂度为 $\Omicron(L+nB\log_BL+L\log_BL)$。考虑取 $B=\frac{L}{n}$,那么复杂度为 $\Omicron(L+\frac{L\log L}{\log L-\log n})=\Omicron(\frac{2L\log L-L\log n}{\log L-\log n})=\Omicron(\frac{L\log L-L\log n}{\log L-\log n })=\Omicron(L)$。这样我们就做到线性了。有个小于 $5$ 的常数。记得特判 $L<2n$。## 代码稍后补。