Skip to content

Commit

Permalink
fix(basic/tim-sort):修正伪代码中英空格 OI-wiki#5536
Browse files Browse the repository at this point in the history
  • Loading branch information
xk2013 committed Apr 20, 2024
1 parent d6a4dc3 commit 84a95ac
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/basic/tim-sort.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ tim 排序的过程就是一个类似归并排序的过程,将数组划分为
$$
\begin{array}{ll}
1 & \textbf{do}\\
2 & \qquad \text{确定} run \text{的起点}\\
3 & \qquad \textbf{if} run \text{比} minRun \text{短}\\
4 & \qquad \qquad \text{延长} run \text{直至} \min(minRun, nRemaining)\\
5 & \qquad \textbf{push} run \text{放到} pending-run stack \text{上}\\
6 & \qquad \textbf{if} pending-run stack \text{最顶上的 2 个} run \text{长度相近}\\
7 & \qquad \qquad \text{合并} pending-run stack \text{最顶上的 2 个} run\\
8 & \qquad \text{start index} \gets \text{start index} + run \text{的长度}\\
9 & \qquad nRemaining \gets nRemaining - run \text{的长度}\\
2 & \qquad \text{确定}\ run\ \text{的起点}\\
3 & \qquad \textbf{if}\ run\ \text{比}\ minRun\ \text{短}\\
4 & \qquad \qquad \text{延长}\ run\ \text{直至}\ \min(minRun, nRemaining)\\
5 & \qquad \textbf{push}\ run\ \text{放到}\ pending-run stack\ \text{上}\\
6 & \qquad \textbf{if}\ pending-run stack\ \text{最顶上的 2 个}\ run\ \text{长度相近}\\
7 & \qquad \qquad \text{合并}\ pending-run stack\ \text{最顶上的 2 个} run\\
8 & \qquad \text{start index} \gets \text{start index} + run\ \text{的长度}\\
9 & \qquad nRemaining \gets nRemaining - run\ \text{的长度}\\
10 & \textbf{while} \text{ } nRemaining \ne 0\\
\end{array}
$$
Expand Down

0 comments on commit 84a95ac

Please sign in to comment.