Skip to content

[lib] For showing complexity, use $N \log N$ #1275

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
Mar 3, 2017
Merged
Show file tree
Hide file tree
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
12 changes: 6 additions & 6 deletions source/algorithms.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3502,7 +3502,7 @@

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

\rSec3[stable.sort]{\tcode{stable_sort}}
Expand Down Expand Up @@ -3541,7 +3541,7 @@
\complexity
At most $N \log^2(N)$
comparisons, where
$N = \tcode{last - first}$, but only $N \log(N)$ comparisons if there is enough extra memory.
$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 @@ -4141,7 +4141,7 @@

\pnum
\complexity
At most $N \log(N)$ swaps, where $N = \tcode{last - first}$,
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}
Expand Down Expand Up @@ -4323,7 +4323,7 @@
\tcode{(last - first) - 1}
comparisons.
If no additional memory is available, an algorithm with complexity
$N \log(N)$ may be used, where $N = \tcode{last - first}$.
$N \log N$ may be used, where $N = \tcode{last - first}$.

\pnum
\remarks Stable~(\ref{algorithm.stable}).
Expand Down Expand Up @@ -4670,7 +4670,7 @@
or a new element added by
\tcode{push_heap()},
in
\bigoh{\log(N)}
\bigoh{\log N}
time.
\end{itemize}

Expand Down Expand Up @@ -4822,7 +4822,7 @@

\pnum
\complexity
At most $N \log(N)$
At most $N \log N$
comparisons, where
$N = \tcode{last - first}$.
\end{itemdescr}
Expand Down
14 changes: 7 additions & 7 deletions source/containers.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1778,7 +1778,7 @@
inserts each element from the range \range{i}{j} if and only if there
is no element with key equivalent to the key of that element in containers
with unique keys; always inserts that element in containers with equivalent keys. &
$N\log (\tcode{a.size()} + N)$, where $N$ has the value \tcode{distance(i, j)} \\ \rowsep
$N \log (\tcode{a.size()} + N)$, where $N$ has the value \tcode{distance(i, j)} \\ \rowsep

\tcode{a.insert(il)} &
\tcode{void} &
Expand Down Expand Up @@ -5067,7 +5067,7 @@
\pnum
\complexity
Approximately
$N \log(N)$
$N \log N$
comparisons, where
\tcode{N == size()}.
\end{itemdescr}
Expand Down Expand Up @@ -5328,7 +5328,7 @@
calls to the copy constructor of
\tcode{T}
and order
$\log(N)$
$\log N$
reallocations if they are just input iterators.
\end{itemdescr}

Expand Down Expand Up @@ -6208,7 +6208,7 @@
Linear in $N$ if the range
\range{first}{last}
is already sorted using \tcode{comp}
and otherwise $N \log{N}$, where $N$
and otherwise $N \log N$, where $N$
is \tcode{last - first}.
\end{itemdescr}

Expand Down Expand Up @@ -6717,7 +6717,7 @@
Linear in $N$ if the range
\range{first}{last}
is already sorted using \tcode{comp}
and otherwise $N \log{N}$,
and otherwise $N \log N$,
where $N$ is
\tcode{last - first}.
\end{itemdescr}
Expand Down Expand Up @@ -7008,7 +7008,7 @@
Linear in $N$ if the range
\range{first}{last}
is already sorted using \tcode{comp}
and otherwise $N \log{N}$,
and otherwise $N \log N$,
where $N$ is
\tcode{last - first}.
\end{itemdescr}
Expand Down Expand Up @@ -7275,7 +7275,7 @@
Linear in $N$
if the range
\range{first}{last}
is already sorted using \tcode{comp} and otherwise $N \log{N}$,
is already sorted using \tcode{comp} and otherwise $N \log N$,
where $N$ is
\tcode{last - first}.
\end{itemdescr}
Expand Down