Skip to content

Commit 17a6a71

Browse files
committed
[lib] For showing complexity, use $N \log N$
and not $N \log(N)$ or other variants. Partially addresses #1088.
1 parent ec9f102 commit 17a6a71

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

source/algorithms.tex

+6-6
Original file line numberDiff line numberDiff line change
@@ -3502,7 +3502,7 @@
35023502

35033503
\pnum
35043504
\complexity
3505-
\bigoh{N\log(N)} comparisons, where $N = \tcode{last - first}$.
3505+
\bigoh{N \log N} comparisons, where $N = \tcode{last - first}$.
35063506
\end{itemdescr}
35073507

35083508
\rSec3[stable.sort]{\tcode{stable_sort}}
@@ -3541,7 +3541,7 @@
35413541
\complexity
35423542
At most $N \log^2(N)$
35433543
comparisons, where
3544-
$N = \tcode{last - first}$, but only $N \log(N)$ comparisons if there is enough extra memory.
3544+
$N = \tcode{last - first}$, but only $N \log N$ comparisons if there is enough extra memory.
35453545

35463546
\pnum
35473547
\remarks Stable~(\ref{algorithm.stable}).
@@ -4141,7 +4141,7 @@
41414141

41424142
\pnum
41434143
\complexity
4144-
At most $N \log(N)$ swaps, where $N = \tcode{last - first}$,
4144+
At most $N \log N$ swaps, where $N = \tcode{last - first}$,
41454145
but only \bigoh{N} swaps if there is enough extra memory.
41464146
Exactly
41474147
\tcode{last - first}
@@ -4323,7 +4323,7 @@
43234323
\tcode{(last - first) - 1}
43244324
comparisons.
43254325
If no additional memory is available, an algorithm with complexity
4326-
$N \log(N)$ may be used, where $N = \tcode{last - first}$.
4326+
$N \log N$ may be used, where $N = \tcode{last - first}$.
43274327

43284328
\pnum
43294329
\remarks Stable~(\ref{algorithm.stable}).
@@ -4670,7 +4670,7 @@
46704670
or a new element added by
46714671
\tcode{push_heap()},
46724672
in
4673-
\bigoh{\log(N)}
4673+
\bigoh{\log N}
46744674
time.
46754675
\end{itemize}
46764676

@@ -4822,7 +4822,7 @@
48224822

48234823
\pnum
48244824
\complexity
4825-
At most $N \log(N)$
4825+
At most $N \log N$
48264826
comparisons, where
48274827
$N = \tcode{last - first}$.
48284828
\end{itemdescr}

source/containers.tex

+7-7
Original file line numberDiff line numberDiff line change
@@ -1778,7 +1778,7 @@
17781778
inserts each element from the range \range{i}{j} if and only if there
17791779
is no element with key equivalent to the key of that element in containers
17801780
with unique keys; always inserts that element in containers with equivalent keys. &
1781-
$N\log (\tcode{a.size()} + N)$, where $N$ has the value \tcode{distance(i, j)} \\ \rowsep
1781+
$N \log (\tcode{a.size()} + N)$, where $N$ has the value \tcode{distance(i, j)} \\ \rowsep
17821782

17831783
\tcode{a.insert(il)} &
17841784
\tcode{void} &
@@ -5067,7 +5067,7 @@
50675067
\pnum
50685068
\complexity
50695069
Approximately
5070-
$N \log(N)$
5070+
$N \log N$
50715071
comparisons, where
50725072
\tcode{N == size()}.
50735073
\end{itemdescr}
@@ -5328,7 +5328,7 @@
53285328
calls to the copy constructor of
53295329
\tcode{T}
53305330
and order
5331-
$\log(N)$
5331+
$\log N$
53325332
reallocations if they are just input iterators.
53335333
\end{itemdescr}
53345334

@@ -6208,7 +6208,7 @@
62086208
Linear in $N$ if the range
62096209
\range{first}{last}
62106210
is already sorted using \tcode{comp}
6211-
and otherwise $N \log{N}$, where $N$
6211+
and otherwise $N \log N$, where $N$
62126212
is \tcode{last - first}.
62136213
\end{itemdescr}
62146214

@@ -6717,7 +6717,7 @@
67176717
Linear in $N$ if the range
67186718
\range{first}{last}
67196719
is already sorted using \tcode{comp}
6720-
and otherwise $N \log{N}$,
6720+
and otherwise $N \log N$,
67216721
where $N$ is
67226722
\tcode{last - first}.
67236723
\end{itemdescr}
@@ -7008,7 +7008,7 @@
70087008
Linear in $N$ if the range
70097009
\range{first}{last}
70107010
is already sorted using \tcode{comp}
7011-
and otherwise $N \log{N}$,
7011+
and otherwise $N \log N$,
70127012
where $N$ is
70137013
\tcode{last - first}.
70147014
\end{itemdescr}
@@ -7275,7 +7275,7 @@
72757275
Linear in $N$
72767276
if the range
72777277
\range{first}{last}
7278-
is already sorted using \tcode{comp} and otherwise $N \log{N}$,
7278+
is already sorted using \tcode{comp} and otherwise $N \log N$,
72797279
where $N$ is
72807280
\tcode{last - first}.
72817281
\end{itemdescr}

0 commit comments

Comments
 (0)