File: dataStructure.tex

package info (click to toggle)
spooles 2.2-5
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 18,824 kB
  • ctags: 3,665
  • sloc: ansic: 146,828; csh: 3,615; makefile: 2,045; perl: 70
file content (26 lines) | stat: -rw-r--r-- 897 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
\par
\section{Data Structure}
\label{section:IIheap:dataStructure}
\par
The {\tt IIheap} object has five fields.
\begin{itemize}
\item 
{\tt int size}    : present size of the heap, {\tt 0 <= size < maxsize} 
\item 
{\tt int maxsize} : maximum size of the heap, set on initialization 
\item 
{\tt int *heapLoc} : 
pointer to an {\tt int} vector of size {\tt maxsize}, 
{\tt heapLoc[i]} contains the location of item {\tt i}, 
{\tt heapLoc[i] = -1} if item {\tt i} is not in the heap 
\item 
{\tt int *keys} : 
pointer to an {\tt int} vector of size {\tt maxsize}, 
{\tt keys[loc]} contains the key at location {\tt loc} 
\item 
{\tt int *values} : 
pointer to an {\tt int} vector of size {\tt maxsize}, 
{\tt values[loc]} contains the value at location {\tt loc} 
\end{itemize}
A correctly initialized and nontrivial {\tt IIheap} object 
will have {\tt maxsize > 0} and {\tt 0 <= size < maxsize}.