11.5: Stack Example (2)
Class STACK[G]
feature -- access / readout
count: INTEGER; -- Number of stack elements
item: G is -- Top element (parametric type G)
require not empty
do … end
feature -- status report
empty: BOOLEAN is --Is stack empty?
do … end
full: BOOLEAN is -- Is stack full?
do … end
-- to be continued
Previous slide
Next slide
Back to first slide
View graphic version