generic
type KeyType is private;
type ElementType is private;
type IndexType is (<>);
type ListType is array (IndexType range <>) of ElementType;
with function KeyOf (Element: ElementType) return KeyType;
with function "<"(Left, Right: KeyType) return Boolean;
procedure Binary_Search_Generic (List : in ListType;
Target : in KeyType;
Location: out IndexType;
Found : out Boolean);
------------------------------------------------------------------
--| Performs an iterative binary search of an ordered array of
--| keys with bounds List'First..List'Last.
--| Pre : Target and List are defined, and List is sorted upward
--| Post: If Target is found in array List, returns True in Found
--| and the location in Location; otherwise,
--| returns False in Found and returns in Location
--| the location in which to insert Target
--| Raises: Ada will raise Constraint_Error
--| if List'Last = IndexType'Last and Target would be
--| inserted beyond List'Last.
--| Author: Michael B. Feldman, The George Washington University
--| Last Modified: October 1995
------------------------------------------------------------------