\section{lib/sparse/\-Binary\-Heap.h File Reference}
\label{BinaryHeap_8h}\index{lib/sparse/\-Binary\-Heap.\-h@{lib/sparse/\-Binary\-Heap.\-h}}
{\ttfamily \#include \char`\"{}general.\-h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}Int\-Stack.\-h\char`\"{}}\\*
Include dependency graph for Binary\-Heap.\-h\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{BinaryHeap_8h__incl}
\end{center}
\end{figure}
This graph shows which files directly or indirectly include this file\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=312pt]{BinaryHeap_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct {\bf Binary\-Heap\-\_\-struct}
\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef struct {\bf Binary\-Heap\-\_\-struct} $\ast$ {\bf Binary\-Heap}
\end{DoxyCompactItemize}
\subsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \{ {\bf Binary\-Heap\-\_\-error\-\_\-malloc} = -\/10
 \}
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
{\bf Binary\-Heap} {\bf Binary\-Heap\-\_\-new} ({\bf int}($\ast$cmp)(void $\ast$item1, void $\ast$item2))
\item 
void {\bf Binary\-Heap\-\_\-delete} ({\bf Binary\-Heap} h, void($\ast$del)(void $\ast${\bf item}))
\item 
{\bf int} {\bf Binary\-Heap\-\_\-insert} ({\bf Binary\-Heap} h, void $\ast${\bf item})
\item 
void $\ast$ {\bf Binary\-Heap\-\_\-get\-\_\-min} ({\bf Binary\-Heap} h)
\item 
void $\ast$ {\bf Binary\-Heap\-\_\-extract\-\_\-min} ({\bf Binary\-Heap} h)
\item 
void $\ast$ {\bf Binary\-Heap\-\_\-extract\-\_\-item} ({\bf Binary\-Heap} h, {\bf int} id)
\item 
void $\ast$ {\bf Binary\-Heap\-\_\-get\-\_\-item} ({\bf Binary\-Heap} h, {\bf int} id)
\item 
{\bf int} {\bf Binary\-Heap\-\_\-reset} ({\bf Binary\-Heap} h, {\bf int} id, void $\ast${\bf item})
\item 
void {\bf Binary\-Heap\-\_\-print} ({\bf Binary\-Heap} h, void($\ast$pnt)(void $\ast$))
\item 
void {\bf Binary\-Heap\-\_\-sanity\-\_\-check} ({\bf Binary\-Heap} h)
\end{DoxyCompactItemize}


\subsection{Typedef Documentation}
\index{Binary\-Heap.\-h@{Binary\-Heap.\-h}!Binary\-Heap@{Binary\-Heap}}
\index{Binary\-Heap@{Binary\-Heap}!BinaryHeap.h@{Binary\-Heap.\-h}}
\subsubsection[{Binary\-Heap}]{\setlength{\rightskip}{0pt plus 5cm}typedef struct {\bf Binary\-Heap\-\_\-struct}$\ast$ {\bf Binary\-Heap}}\label{BinaryHeap_8h_a52882dbb891cee0b4eca66fcc6e37f70}


Definition at line 50 of file Binary\-Heap.\-h.



\subsection{Enumeration Type Documentation}
\subsubsection[{anonymous enum}]{\setlength{\rightskip}{0pt plus 5cm}anonymous enum}\label{BinaryHeap_8h_afa231099d07583c3ed0981e0bb665f55}
\begin{Desc}
\item[Enumerator]\par
\begin{description}
\index{Binary\-Heap\-\_\-error\-\_\-malloc@{Binary\-Heap\-\_\-error\-\_\-malloc}!Binary\-Heap.\-h@{Binary\-Heap.\-h}}\index{Binary\-Heap.\-h@{Binary\-Heap.\-h}!Binary\-Heap\-\_\-error\-\_\-malloc@{Binary\-Heap\-\_\-error\-\_\-malloc}}\item[{\em 
Binary\-Heap\-\_\-error\-\_\-malloc\label{BinaryHeap_8h_afa231099d07583c3ed0981e0bb665f55a0ac3e0db51d9e2f87c4bdb7e4f40109e}
}]\end{description}
\end{Desc}


Definition at line 48 of file Binary\-Heap.\-h.



\subsection{Function Documentation}
\index{Binary\-Heap.\-h@{Binary\-Heap.\-h}!Binary\-Heap\-\_\-delete@{Binary\-Heap\-\_\-delete}}
\index{Binary\-Heap\-\_\-delete@{Binary\-Heap\-\_\-delete}!BinaryHeap.h@{Binary\-Heap.\-h}}
\subsubsection[{Binary\-Heap\-\_\-delete}]{\setlength{\rightskip}{0pt plus 5cm}void Binary\-Heap\-\_\-delete (
\begin{DoxyParamCaption}
\item[{{\bf Binary\-Heap}}]{h, }
\item[{void($\ast$)(void $\ast${\bf item})}]{del}
\end{DoxyParamCaption}
)}\label{BinaryHeap_8h_a6fd27466952b94b1b2884abe891047fc}


Definition at line 34 of file Binary\-Heap.\-c.



References F\-R\-E\-E, Binary\-Heap\-\_\-struct\-::heap, Binary\-Heap\-\_\-struct\-::id\-\_\-stack, Binary\-Heap\-\_\-struct\-::id\-\_\-to\-\_\-pos, Int\-Stack\-\_\-delete(), Binary\-Heap\-\_\-struct\-::len, and Binary\-Heap\-\_\-struct\-::pos\-\_\-to\-\_\-id.

\index{Binary\-Heap.\-h@{Binary\-Heap.\-h}!Binary\-Heap\-\_\-extract\-\_\-item@{Binary\-Heap\-\_\-extract\-\_\-item}}
\index{Binary\-Heap\-\_\-extract\-\_\-item@{Binary\-Heap\-\_\-extract\-\_\-item}!BinaryHeap.h@{Binary\-Heap.\-h}}
\subsubsection[{Binary\-Heap\-\_\-extract\-\_\-item}]{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ Binary\-Heap\-\_\-extract\-\_\-item (
\begin{DoxyParamCaption}
\item[{{\bf Binary\-Heap}}]{h, }
\item[{{\bf int}}]{id}
\end{DoxyParamCaption}
)}\label{BinaryHeap_8h_a3b39c8822c3cd6ed6c35b1f805369177}


Definition at line 175 of file Binary\-Heap.\-c.



References assert, Binary\-Heap\-\_\-struct\-::heap, Binary\-Heap\-\_\-struct\-::id\-\_\-stack, Binary\-Heap\-\_\-struct\-::id\-\_\-to\-\_\-pos, Int\-Stack\-\_\-push(), Binary\-Heap\-\_\-struct\-::len, Binary\-Heap\-\_\-struct\-::max\-\_\-len, and N\-U\-L\-L.



Referenced by Binary\-Heap\-\_\-extract\-\_\-min().

\index{Binary\-Heap.\-h@{Binary\-Heap.\-h}!Binary\-Heap\-\_\-extract\-\_\-min@{Binary\-Heap\-\_\-extract\-\_\-min}}
\index{Binary\-Heap\-\_\-extract\-\_\-min@{Binary\-Heap\-\_\-extract\-\_\-min}!BinaryHeap.h@{Binary\-Heap.\-h}}
\subsubsection[{Binary\-Heap\-\_\-extract\-\_\-min}]{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ Binary\-Heap\-\_\-extract\-\_\-min (
\begin{DoxyParamCaption}
\item[{{\bf Binary\-Heap}}]{h}
\end{DoxyParamCaption}
)}\label{BinaryHeap_8h_afdc0f98038b09ec5724be501e36e9eb3}


Definition at line 169 of file Binary\-Heap.\-c.



References Binary\-Heap\-\_\-extract\-\_\-item(), Binary\-Heap\-\_\-struct\-::len, N\-U\-L\-L, and Binary\-Heap\-\_\-struct\-::pos\-\_\-to\-\_\-id.

\index{Binary\-Heap.\-h@{Binary\-Heap.\-h}!Binary\-Heap\-\_\-get\-\_\-item@{Binary\-Heap\-\_\-get\-\_\-item}}
\index{Binary\-Heap\-\_\-get\-\_\-item@{Binary\-Heap\-\_\-get\-\_\-item}!BinaryHeap.h@{Binary\-Heap.\-h}}
\subsubsection[{Binary\-Heap\-\_\-get\-\_\-item}]{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ Binary\-Heap\-\_\-get\-\_\-item (
\begin{DoxyParamCaption}
\item[{{\bf Binary\-Heap}}]{h, }
\item[{{\bf int}}]{id}
\end{DoxyParamCaption}
)}\label{BinaryHeap_8h_a96955c59ab1dc25822b7aa4790c3a9d2}


Definition at line 225 of file Binary\-Heap.\-c.



References Binary\-Heap\-\_\-struct\-::heap, Binary\-Heap\-\_\-struct\-::id\-\_\-to\-\_\-pos, Binary\-Heap\-\_\-struct\-::max\-\_\-len, and N\-U\-L\-L.

\index{Binary\-Heap.\-h@{Binary\-Heap.\-h}!Binary\-Heap\-\_\-get\-\_\-min@{Binary\-Heap\-\_\-get\-\_\-min}}
\index{Binary\-Heap\-\_\-get\-\_\-min@{Binary\-Heap\-\_\-get\-\_\-min}!BinaryHeap.h@{Binary\-Heap.\-h}}
\subsubsection[{Binary\-Heap\-\_\-get\-\_\-min}]{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ Binary\-Heap\-\_\-get\-\_\-min (
\begin{DoxyParamCaption}
\item[{{\bf Binary\-Heap}}]{h}
\end{DoxyParamCaption}
)}\label{BinaryHeap_8h_af0c6cc3683bab332d35f3a6c44e32443}


Definition at line 164 of file Binary\-Heap.\-c.



References Binary\-Heap\-\_\-struct\-::heap.

\index{Binary\-Heap.\-h@{Binary\-Heap.\-h}!Binary\-Heap\-\_\-insert@{Binary\-Heap\-\_\-insert}}
\index{Binary\-Heap\-\_\-insert@{Binary\-Heap\-\_\-insert}!BinaryHeap.h@{Binary\-Heap.\-h}}
\subsubsection[{Binary\-Heap\-\_\-insert}]{\setlength{\rightskip}{0pt plus 5cm}{\bf int} Binary\-Heap\-\_\-insert (
\begin{DoxyParamCaption}
\item[{{\bf Binary\-Heap}}]{h, }
\item[{void $\ast$}]{item}
\end{DoxyParamCaption}
)}\label{BinaryHeap_8h_aa4f1e62e8254012fb857124399f74660}


Definition at line 137 of file Binary\-Heap.\-c.



References assert, Binary\-Heap\-\_\-error\-\_\-malloc, Binary\-Heap\-\_\-struct\-::heap, Binary\-Heap\-\_\-struct\-::id\-\_\-stack, Binary\-Heap\-\_\-struct\-::id\-\_\-to\-\_\-pos, Int\-Stack\-\_\-pop(), Binary\-Heap\-\_\-struct\-::len, Binary\-Heap\-\_\-struct\-::max\-\_\-len, N\-U\-L\-L, and Binary\-Heap\-\_\-struct\-::pos\-\_\-to\-\_\-id.

\index{Binary\-Heap.\-h@{Binary\-Heap.\-h}!Binary\-Heap\-\_\-new@{Binary\-Heap\-\_\-new}}
\index{Binary\-Heap\-\_\-new@{Binary\-Heap\-\_\-new}!BinaryHeap.h@{Binary\-Heap.\-h}}
\subsubsection[{Binary\-Heap\-\_\-new}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Binary\-Heap} Binary\-Heap\-\_\-new (
\begin{DoxyParamCaption}
\item[{{\bf int}($\ast$)(void $\ast$item1, void $\ast$item2)}]{cmp}
\end{DoxyParamCaption}
)}\label{BinaryHeap_8h_a54d05122a9a52ccc8b81a25c84fa09b4}


Definition at line 16 of file Binary\-Heap.\-c.



References Binary\-Heap\-\_\-struct\-::cmp, Binary\-Heap\-\_\-struct\-::heap, Binary\-Heap\-\_\-struct\-::id\-\_\-stack, Binary\-Heap\-\_\-struct\-::id\-\_\-to\-\_\-pos, Int\-Stack\-\_\-new(), Binary\-Heap\-\_\-struct\-::len, M\-A\-L\-L\-O\-C, Binary\-Heap\-\_\-struct\-::max\-\_\-len, and Binary\-Heap\-\_\-struct\-::pos\-\_\-to\-\_\-id.

\index{Binary\-Heap.\-h@{Binary\-Heap.\-h}!Binary\-Heap\-\_\-print@{Binary\-Heap\-\_\-print}}
\index{Binary\-Heap\-\_\-print@{Binary\-Heap\-\_\-print}!BinaryHeap.h@{Binary\-Heap.\-h}}
\subsubsection[{Binary\-Heap\-\_\-print}]{\setlength{\rightskip}{0pt plus 5cm}void Binary\-Heap\-\_\-print (
\begin{DoxyParamCaption}
\item[{{\bf Binary\-Heap}}]{h, }
\item[{void($\ast$)(void $\ast$)}]{pnt}
\end{DoxyParamCaption}
)}\label{BinaryHeap_8h_a002ae90689d22a37ddba81b7c350bfc6}


Definition at line 273 of file Binary\-Heap.\-c.



References Binary\-Heap\-\_\-struct\-::heap, Binary\-Heap\-\_\-struct\-::id\-\_\-stack, Binary\-Heap\-\_\-struct\-::id\-\_\-to\-\_\-pos, Int\-Stack\-\_\-struct\-::last, Binary\-Heap\-\_\-struct\-::len, Binary\-Heap\-\_\-struct\-::pos\-\_\-to\-\_\-id, and Int\-Stack\-\_\-struct\-::stack.

\index{Binary\-Heap.\-h@{Binary\-Heap.\-h}!Binary\-Heap\-\_\-reset@{Binary\-Heap\-\_\-reset}}
\index{Binary\-Heap\-\_\-reset@{Binary\-Heap\-\_\-reset}!BinaryHeap.h@{Binary\-Heap.\-h}}
\subsubsection[{Binary\-Heap\-\_\-reset}]{\setlength{\rightskip}{0pt plus 5cm}{\bf int} Binary\-Heap\-\_\-reset (
\begin{DoxyParamCaption}
\item[{{\bf Binary\-Heap}}]{h, }
\item[{{\bf int}}]{id, }
\item[{void $\ast$}]{item}
\end{DoxyParamCaption}
)}\label{BinaryHeap_8h_aa87dcc11b5d4d2f36d34ca48f275e034}


Definition at line 208 of file Binary\-Heap.\-c.



References Binary\-Heap\-\_\-struct\-::heap, Binary\-Heap\-\_\-struct\-::id\-\_\-to\-\_\-pos, and Binary\-Heap\-\_\-struct\-::max\-\_\-len.

\index{Binary\-Heap.\-h@{Binary\-Heap.\-h}!Binary\-Heap\-\_\-sanity\-\_\-check@{Binary\-Heap\-\_\-sanity\-\_\-check}}
\index{Binary\-Heap\-\_\-sanity\-\_\-check@{Binary\-Heap\-\_\-sanity\-\_\-check}!BinaryHeap.h@{Binary\-Heap.\-h}}
\subsubsection[{Binary\-Heap\-\_\-sanity\-\_\-check}]{\setlength{\rightskip}{0pt plus 5cm}void Binary\-Heap\-\_\-sanity\-\_\-check (
\begin{DoxyParamCaption}
\item[{{\bf Binary\-Heap}}]{h}
\end{DoxyParamCaption}
)}\label{BinaryHeap_8h_a87ed81848857b8052f565b0e5e71f185}


Definition at line 237 of file Binary\-Heap.\-c.



References assert, Binary\-Heap\-\_\-struct\-::cmp, F\-R\-E\-E, Binary\-Heap\-\_\-struct\-::heap, Binary\-Heap\-\_\-struct\-::id\-\_\-stack, Binary\-Heap\-\_\-struct\-::id\-\_\-to\-\_\-pos, Int\-Stack\-\_\-get\-\_\-length, Int\-Stack\-\_\-struct\-::last, Binary\-Heap\-\_\-struct\-::len, M\-A\-L\-L\-O\-C, Parent\-Pos, Binary\-Heap\-\_\-struct\-::pos\-\_\-to\-\_\-id, and Int\-Stack\-\_\-struct\-::stack.

