Skip to content
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

Chapter 13: Constant Time Lookup of Next Node #85

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions chapter04.tex
Original file line number Diff line number Diff line change
Expand Up @@ -605,10 +605,10 @@ \subsubsection{Priority queue}
maintains a set of elements.
The supported operations are insertion and,
depending on the type of the queue,
retrieval and removal of
lookup and removal of
either the minimum or maximum element.
Insertion and removal take $O(\log n)$ time,
and retrieval takes $O(1)$ time.
and lookup takes $O(1)$ time.

While an ordered set efficiently supports
all the operations of a priority queue,
Expand Down
2 changes: 1 addition & 1 deletion chapter13.tex
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ \subsubsection{Implementation}
An appropriate data structure for this is a priority queue
that contains the nodes ordered by their distances.
Using a priority queue, the next node to be processed
can be retrieved in logarithmic time.
can be looked up in constant and removed in logarithmic time.

In the following code, the priority queue
\texttt{q} contains pairs of the form $(-d,x)$,
Expand Down