Small fixes
This commit is contained in:
parent
55b55d1fc1
commit
8028fddfa6
|
@ -836,7 +836,7 @@ calculate logarithms to some fixed base.
|
||||||
\index{natural logarithm}
|
\index{natural logarithm}
|
||||||
|
|
||||||
The \key{natural logarithm} $\ln(x)$ of a number $x$
|
The \key{natural logarithm} $\ln(x)$ of a number $x$
|
||||||
is a logarithm whose base is $e \approx 2{,}71828$.
|
is a logarithm whose base is $e \approx 2.71828$.
|
||||||
|
|
||||||
Another property of logarithms is that
|
Another property of logarithms is that
|
||||||
the number of digits of an integer $x$ in base $b$ is
|
the number of digits of an integer $x$ in base $b$ is
|
||||||
|
|
|
@ -512,7 +512,7 @@ the lower-right corner and count the number of such paths.
|
||||||
\item
|
\item
|
||||||
running time: 483 seconds
|
running time: 483 seconds
|
||||||
\item
|
\item
|
||||||
recursive calls: 76 billions
|
recursive calls: 76 billion
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
|
|
||||||
\subsubsection{Optimization 1}
|
\subsubsection{Optimization 1}
|
||||||
|
@ -566,7 +566,7 @@ and finally multiply the number of the solutions by two.
|
||||||
\item
|
\item
|
||||||
running time: 244 seconds
|
running time: 244 seconds
|
||||||
\item
|
\item
|
||||||
recursive calls: 38 billions
|
recursive calls: 38 billion
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
|
|
||||||
\subsubsection{Optimization 2}
|
\subsubsection{Optimization 2}
|
||||||
|
@ -595,7 +595,7 @@ immediately if we reach the lower-right square too early.
|
||||||
\item
|
\item
|
||||||
running time: 119 seconds
|
running time: 119 seconds
|
||||||
\item
|
\item
|
||||||
recursive calls: 20 billions
|
recursive calls: 20 billion
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
|
|
||||||
\subsubsection{Optimization 3}
|
\subsubsection{Optimization 3}
|
||||||
|
@ -627,7 +627,7 @@ It turns out that this optimization is very useful:
|
||||||
\item
|
\item
|
||||||
running time: 1.8 seconds
|
running time: 1.8 seconds
|
||||||
\item
|
\item
|
||||||
recursive calls: 221 millions
|
recursive calls: 221 million
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
|
|
||||||
\subsubsection{Optimization 4}
|
\subsubsection{Optimization 4}
|
||||||
|
@ -664,7 +664,7 @@ very efficient:
|
||||||
\item
|
\item
|
||||||
running time: 0.6 seconds
|
running time: 0.6 seconds
|
||||||
\item
|
\item
|
||||||
recursive calls: 69 millions
|
recursive calls: 69 million
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
|
|
||||||
~\\
|
~\\
|
||||||
|
|
|
@ -245,7 +245,7 @@ to the position of $X$.
|
||||||
Next we will see how we can
|
Next we will see how we can
|
||||||
process range minimum queries in $O(1)$ time
|
process range minimum queries in $O(1)$ time
|
||||||
after an $O(n \log n)$ time preprocessing using \index{sparse table}
|
after an $O(n \log n)$ time preprocessing using \index{sparse table}
|
||||||
a data structure called a \emph{sparse table}\footnote{The
|
a data structure called a \key{sparse table}\footnote{The
|
||||||
sparse table structure was introduced in \cite{ben00}.
|
sparse table structure was introduced in \cite{ben00}.
|
||||||
There are also more sophisticated techniques \cite{fis06} where
|
There are also more sophisticated techniques \cite{fis06} where
|
||||||
the preprocessing time of the array is only $O(n)$, but such algorithms
|
the preprocessing time of the array is only $O(n)$, but such algorithms
|
||||||
|
|
|
@ -603,7 +603,7 @@ is named after R. W. Floyd and S. Warshall
|
||||||
who published it independently in 1962 \cite{flo62,war62}.}
|
who published it independently in 1962 \cite{flo62,war62}.}
|
||||||
is an alternative way to approach the problem
|
is an alternative way to approach the problem
|
||||||
of finding shortest paths.
|
of finding shortest paths.
|
||||||
Unlike the other algorihms in this chapter,
|
Unlike the other algorithms in this chapter,
|
||||||
it finds all shortest paths between the nodes
|
it finds all shortest paths between the nodes
|
||||||
in a single run.
|
in a single run.
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,7 @@ Of course, this strategy requires that
|
||||||
the number of sticks is \emph{not} divisible by 4
|
the number of sticks is \emph{not} divisible by 4
|
||||||
when it is our move.
|
when it is our move.
|
||||||
If it is, there is nothing we can do,
|
If it is, there is nothing we can do,
|
||||||
but the opponent will win the game if
|
and the opponent will win the game if
|
||||||
they play optimally.
|
they play optimally.
|
||||||
|
|
||||||
\subsubsection{State graph}
|
\subsubsection{State graph}
|
||||||
|
|
|
@ -401,7 +401,7 @@ and the next range is
|
||||||
\end{tikzpicture}
|
\end{tikzpicture}
|
||||||
\end{center}
|
\end{center}
|
||||||
there will be three steps:
|
there will be three steps:
|
||||||
the left endpoint moves one step to the left,
|
the left endpoint moves one step to the right,
|
||||||
and the right endpoint moves two steps to the right.
|
and the right endpoint moves two steps to the right.
|
||||||
|
|
||||||
After each step, the array \texttt{c}
|
After each step, the array \texttt{c}
|
||||||
|
|
Loading…
Reference in New Issue