with Text_io; generic type ELEMENT is private; with function "<"(LEFT,RIGHT:ELEMENT) return Boolean is <>; with procedure Put(X:ELEMENT) is <>; package ORDERED_SETS is -- by R J Botting, CSUSB type OSET is limited private; -- all operations will be element by element NULL_SET:constant OSET; function Member(I:ELEMENT; ISIN:OSET) return boolean; function Empty(ISIN:OSET) return boolean;--Empty(NULL_SET); function Full(ISIN:OSET) return boolean; function Max(S:OSET) return ELEMENT; function Min(S:OSET) return ELEMENT; procedure Empty(S:out OSET); -- Makes S into an empty set procedure Put(S:in OSET); -- output set to standard output procedure Put(I:ELEMENT; INTO:in out OSET); -- put I into set procedure Get(I: out ELEMENT; FROM:in out OSET);--get fastest procedure Getmin(I: out ELEMENT; FROM:in out OSET);--get first procedure Getmax(I: out ELEMENT; FROM:in out OSET);--get last procedure Take(I: ELEMENT; FROM:in out OSET);--take I out EMPTY_GET: exception;--Attempt to get next/max/min element from empty set FULL_PUT : exception;-- Attempt to add element when no space allocated private -- A link is made to a hidden data structure called DATA type DATA; type OSET is access DATA; NULL_SET:constant OSET := NULL; end ORDERED_SETS;