Skip to content
Snippets Groups Projects
Commit fcec9a44 authored by Florian Unger's avatar Florian Unger
Browse files

typo: off by one in insertionsort

parent 2e8e73ce
Branches
No related tags found
No related merge requests found
......@@ -26,7 +26,7 @@ genannt.
\For{$i \leftarrow 2$ \KwTo n}{
$h \leftarrow A_i$ \;
$j \leftarrow i-1$ \;
\While{$A_j>h$ \textbf{and} $j>0$}{
\While{$A_j>h$ \textbf{and} $j0$}{
$A_{j+1} \leftarrow A_j$ \;
$j \leftarrow j-1$ \;
}
......@@ -61,7 +61,7 @@ Pseudocode & Zeitkonstante & Wiederholungen\\
\hline
\hspace{0.8cm} $j \leftarrow i-1$ & $c_3$ & $\left(n-1\right)$ \\
\hline
\hspace{0.8cm} $\textbf{while } A_j > h \textbf{ and } j>0 \textbf{ do}$ & $c_4$ & $\sum_{i=2}^n t_i$ \\
\hspace{0.8cm} $\textbf{while } A_j > h \textbf{ and } >0 \textbf{ do}$ & $c_4$ & $\sum_{i=2}^n t_i$ \\
\hline
\hspace{1.3cm} $A_{j+1} \leftarrow A_j$ & $c_5$ & $\sum_{i=2}^n(t_i-1)$ \\
\hline
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment