Skip to content

[algorithms] Improve typographic consistency of complexity expressions #590

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

Merged
merged 1 commit into from
Dec 21, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 12 additions & 23 deletions source/algorithms.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2271,9 +2271,8 @@

\pnum
\complexity
At most
\tcode{(last - first) * log(last - first)}
swaps, but only linear number of swaps if there is enough extra memory.
At most $N \log(N)$ swaps, where $N = \tcode{last - first}$,
but only \bigoh{N} swaps if there is enough extra memory.
Exactly
\tcode{last - first}
applications of the predicate.
Expand Down Expand Up @@ -2324,7 +2323,7 @@
\returns An iterator \tcode{mid} such that \tcode{all_of(first, mid, pred)} and \tcode{none_of(mid, last, pred)} are both true.

\pnum
\complexity \bigoh{log(last - first)} applications of \tcode{pred}.
\complexity \bigoh{\log(\tcode{last - first})} applications of \tcode{pred}.
\end{itemdescr}


Expand Down Expand Up @@ -2481,10 +2480,7 @@

\pnum
\complexity
\bigoh{N\log(N)}
(where
\tcode{$N$ == last - first})
comparisons.
\bigoh{N\log(N)} comparisons, where $N = \tcode{last - first}$.
\end{itemdescr}

\rSec3[stable.sort]{\tcode{stable_sort}}
Expand Down Expand Up @@ -2515,11 +2511,9 @@

\pnum
\complexity
It does at most $N \log^2(N)$
(where
\tcode{$N$ == last - first})
comparisons; if enough extra memory is available, it is
$N \log(N)$.
At most $N \log^2(N)$
comparisons, where
$N = \tcode{last - first}$, but only $N \log(N)$ comparisons if there is enough extra memory.

\pnum
\remarks Stable~(\ref{algorithm.stable}).
Expand Down Expand Up @@ -3045,12 +3039,7 @@
\tcode{(last - first) - 1}
comparisons.
If no additional memory is available, an algorithm with complexity
$N \log(N)$
(where
\tcode{N}
is equal to
\tcode{last - first})
may be used.
$N \log(N)$ may be used, where $N = \tcode{last - first}$.

\pnum
\remarks Stable~(\ref{algorithm.stable}).
Expand Down Expand Up @@ -3381,7 +3370,7 @@
\pnum
\complexity
At most
\tcode{log(last - first)}
$\log(\tcode{last - first})$
comparisons.
\end{itemdescr}

Expand Down Expand Up @@ -3422,7 +3411,7 @@
\pnum
\complexity
At most
\tcode{2 * log(last - first)}
$2 \log(\tcode{last - first})$
comparisons.
\end{itemdescr}

Expand Down Expand Up @@ -3488,8 +3477,8 @@
\pnum
\complexity
At most $N \log(N)$
comparisons (where
\tcode{N == last - first}).
comparisons, where
$N = \tcode{last - first}$.
\end{itemdescr}

\rSec3[is.heap]{\tcode{is_heap}}
Expand Down