


Endnotes
- 1
- We apologize to international readers for this obviously North American example.
Return
- 2
- A more robust program would also check to see if the stack were empty before attempting to perform
the pop() operation.
Return
- 3
- As noted in a previous footnote, support for initializing containers using a pair of iterators requires a
feature that is not yet widely supported by compilers, so it may not yet be available on your system.
Return
- 4
- Details of the algorithms used in manipulating heaps will not be discussed here, but such information
is readily available in almost any textbook on data structures.
Return
- 5
- In theory one could store references instead of pointers, but the Standard C++ Library containers cannot
hold references.
Return
- 6
- We describe the priority queue as a structure for quickly discovering the smallest element in a sequence.
If, instead, your problem requires the discovery of the largest element, there are various possibilities.
One is to supply the inverse operator as either a template argument or the optional comparison function
argument to the constructor. If you are defining the comparison argument as a function, as in the example
problem, another solution is to simply invert the comparison test.
Return
- 7
- Remember, the ability to initialize a container using a pair of iterators requires the ability to declare a
template member function using template arguments independent of those used to declare the container.
At present not all compilers support this feature.
Return
OEM Edition, ©Copyright 1999, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.