Small fixes

This commit is contained in:
Antti H S Laaksonen 2017-05-07 00:49:58 +03:00
parent c1154d9147
commit af228c7e46
1 changed files with 9 additions and 9 deletions

View File

@ -931,24 +931,24 @@ $3+4-2\cdot2=3$.
\section{Offline algorithms}
So far, we have discussed \emph{online} algorithms
that are able to efficiently process queries
one after another in a given order.
In particular, we may require that the algorithm
processes each query before receiving the next query.
for tree queries.
Those algorithms are able to process
queries one after another so that
each query is answered before receiving the next query.
However, in many problems, the online
property is not necessary.
In this section, we focus on \emph{offline} algorithms
that are given a set of queries that can be
processed in any order.
In this section, we focus on \emph{offline} algorithms.
Those algorithms are given a set of queries which can
be answered in any order.
It is often easier to design an offline algorithm
compared to an online algorithm.
\subsubsection{Merging data structures}
One method to construct an offline algorithm
is to traverse the tree recursively
and maintain data structures for processing queries.
is to perform a depth-first tree traversal
and maintain data structures in nodes.
At each node $s$, we create a data structure
$\texttt{d}[s]$ that is based on the
data structures of the children of $s$.