Skip to content

Commit

Permalink
Reformated several "Complexity" clauses.
Browse files Browse the repository at this point in the history
  • Loading branch information
cassioneri authored and jwakely committed Jan 5, 2016
1 parent 03b88ce commit 44b21ac
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
16 changes: 8 additions & 8 deletions source/algorithms.tex
Expand Up @@ -3443,7 +3443,7 @@
\pnum
\complexity
At most
\tcode{3 * (last - first)}
$3(\tcode{last - first})$
comparisons.
\end{itemdescr}

Expand Down Expand Up @@ -3683,7 +3683,7 @@
equivalent to the largest.

\pnum
\complexity At most \tcode{(3/2) * t.size()} applications of the corresponding predicate.
\complexity At most $(3/2)\tcode{t.size()}$ applications of the corresponding predicate.
\end{itemdescr}

\indexlibrary{\idxcode{min_element}}%
Expand Down Expand Up @@ -3719,7 +3719,7 @@
\pnum
\complexity
Exactly
\tcode{max((last - first) - 1, 0)}
$\max(\tcode{last - first} - 1, 0)$
applications of the corresponding comparisons.
\end{itemdescr}

Expand Down Expand Up @@ -3755,7 +3755,7 @@
\pnum
\complexity
Exactly
\tcode{max((last - first) - 1, 0)}
$\max(\tcode{last - first} - 1, 0)$
applications of the corresponding comparisons.
\end{itemdescr}

Expand All @@ -3782,7 +3782,7 @@
\pnum
\complexity
At most
$max(\lfloor{\frac{3}{2}} (N-1)\rfloor, 0)$
$\max(\lfloor{\frac{3}{2}} (N-1)\rfloor, 0)$
applications of the corresponding predicate, where $N$ is \tcode{last - first}.
\end{itemdescr}

Expand Down Expand Up @@ -3816,7 +3816,7 @@
\pnum
\complexity
At most
\tcode{2*min((last1 - first1), (last2 - first2))}
$2\min(\tcode{last1 - first1}, \tcode{last2 - first2})$

This comment has been minimized.

Copy link
@tkoeppe

tkoeppe Jan 5, 2016

This should be fine as is.

applications of the corresponding comparison.

\pnum
Expand Down Expand Up @@ -3882,7 +3882,7 @@
\pnum
\complexity
At most
\tcode{(last - first)/2}
$(\tcode{last - first})/2$
swaps.
\end{itemdescr}

Expand Down Expand Up @@ -3925,7 +3925,7 @@
\pnum
\complexity
At most
\tcode{(last - first)/2}
$(\tcode{last - first})/2$
swaps.
\end{itemdescr}

Expand Down
24 changes: 12 additions & 12 deletions source/containers.tex
Expand Up @@ -1391,7 +1391,7 @@
and \tcode{CopyAssignable}.\br
\effects Assigns the range \range{il.begin()}{il.end()} into \tcode{a}. All
existing elements of \tcode{a} are either assigned to or destroyed. &
$N log N$ in general (where $N$ has the value \tcode{il.size() + a.size()});
$N \log N$ in general (where $N$ has the value \tcode{il.size() + a.size()});
linear if \range{il.begin()}{il.end()} is sorted with \tcode{value_comp()}.
\\ \rowsep

Expand Down Expand Up @@ -1485,7 +1485,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 (\mathrm{a.size}() + N)$ ($N$ has the value \tcode{distance(i, j)} \\ \rowsep
$N\log (\tcode{a.size()} + N)$ ($N$ has the value \tcode{distance(i, j)}) \\ \rowsep

\tcode{a.insert(il)} &
\tcode{void} &
Expand All @@ -1496,7 +1496,7 @@
\tcode{size_type} &
erases all elements in the container with key equivalent to
\tcode{k}. returns the number of erased elements. &
$\log (\mathrm{a.size}()) + \mathrm{a.count}(k)$ \\ \rowsep
$\log (\tcode{a.size()}) + \tcode{a.count(k)}$ \\ \rowsep

\tcode{a.erase(q)} &
\tcode{iterator} &
Expand All @@ -1518,7 +1518,7 @@
erases all the elements in the range \range{q1}{q2}. Returns an iterator pointing to
the element pointed to by q2 prior to any elements being erased. If no such element
exists, \tcode{a.end()} is returned. &
$\log (\mathrm{a.size}()) + N$ where $N$ has the value \tcode{distance(q1, q2)}. \\ \rowsep
$\log (\tcode{a.size()}) + N$ where $N$ has the value \tcode{distance(q1, q2)}. \\ \rowsep

\tcode{a.clear()} &
\tcode{void} &
Expand All @@ -1543,14 +1543,14 @@
\tcode{a.count(k)} &
\tcode{size_type} &
returns the number of elements with key equivalent to \tcode{k} &
$\log (\mathrm{a.size}()) + \mathrm{a.count}(k)$ \\ \rowsep
$\log (\tcode{a.size()}) + \tcode{a.count(k)}$ \\ \rowsep

\tcode{a_tran.}\br
\tcode{count(ke)} &
\tcode{size_type} &
returns the number of elements with key \tcode{r} such that
\tcode{!c(r, ke) \&\& !c(ke, r)} &
$\log (\mathrm{a\_tran.size}()) + \mathrm{a\_tran.count}(\mathrm{ke})$ \\ \rowsep
$\log (\tcode{a_tran.size()}) + \tcode{a_tran.count(ke)}$ \\ \rowsep

\tcode{a.lower_bound(k)} &
\tcode{iterator}; \tcode{const_iterator} for constant \tcode{a}. &
Expand Down Expand Up @@ -1889,7 +1889,7 @@
\effects\ Constructs an empty container with at least \tcode{n} buckets,
using \tcode{hf} as the hash function and \tcode{eq} as the key
equality predicate.
& \bigoh{n}
& \bigoh{\tcode{n}}
\\ \rowsep
%
\tcode{X(n, hf)}\br \tcode{X a(n, hf)}
Expand All @@ -1899,7 +1899,7 @@
\effects\ Constructs an empty container with at least \tcode{n} buckets,
using \tcode{hf} as the hash function and \tcode{key_equal()} as the key
equality predicate.
& \bigoh{n}
& \bigoh{\tcode{n}}
\\ \rowsep
%
\tcode{X(n)}\br \tcode{X a(n)}
Expand All @@ -1908,7 +1908,7 @@
\effects\ Constructs an empty container with at least \tcode{n} buckets,
using \tcode{hasher()} as the hash function and \tcode{key_equal()}
as the key equality predicate.
& \bigoh{n}
& \bigoh{\tcode{n}}
\\ \rowsep
%
\tcode{X()}\br \tcode{X a}
Expand Down Expand Up @@ -2116,7 +2116,7 @@
\indextext{unordered associative containers!\idxcode{insert}}%
\indextext{\idxcode{insert}!unordered associative containers}%
& Average case \bigoh{N}, where $N$ is \tcode{distance(i, j)}. Worst
case \bigoh{N * \tcode{(a.size())}\br\tcode{+ N}}.
case $\bigoh{N(\tcode{a.size()} + 1)}$.
\\ \rowsep
%
\tcode{a.insert(il)}
Expand Down Expand Up @@ -3758,7 +3758,7 @@
\throws Nothing.

\pnum
\complexity \bigoh{distance(x.begin(), x.end())}
\complexity \bigoh{\tcode{distance(x.begin(), x.end())}}
\end{itemdescr}

\indexlibrary{\idxcode{splice_after}!\idxcode{forward_list}}%
Expand Down Expand Up @@ -3815,7 +3815,7 @@
behave as iterators into \tcode{*this}, not into \tcode{x}.

\pnum
\complexity \bigoh{distance(first, last)}
\complexity \bigoh{\tcode{distance(first, last)}}
\end{itemdescr}

\indexlibrary{\idxcode{remove}!\idxcode{forward_list}}%
Expand Down

0 comments on commit 44b21ac

Please sign in to comment.