MGH_STACK__DEFINE Class Name
MGH_Stack Purpose
This class implements a last-in-first-out (LIFO) stack as a singly
linked list. Category
Miscellaneous.
IMPLEMENTATION:
The implementation is very straightforard. Items are added (always
to the end of the stack) via the Add method and retrieved (always
from the same end) via the Get method. Retrieving a value removes
it from the stack. The number of values is returned by the COUNT
property or the Count method.
PERFORMANCE:
The time taken to create a stack, add 100,000 real numbers,
retrieve them all then destroy the stack is 9.4 s on my PC (Compaq
Deskpro with Pentium II 400 MHz).
###########################################################################
This software is provided subject to the following conditions:
1. NIWA makes no representations or warranties regarding the
accuracy of the software, the use to which the software may
be put or the results to be obtained from the use of the
software. Accordingly NIWA accepts no liability for any loss
or damage (whether direct of indirect) incurred by any person
through the use of or reliance on the software.
2. NIWA is to be acknowledged as the original author of the
software where the software is used or presented in any form.
###########################################################################
Modification History
Mark Hadfield, 1999-10:
Written.