generic type INDEX is range <>; type ITEM is private; with function "<"(Left,Right:ITEM) return Boolean is <>; type LIST is array (INDEX range <>) of ITEM; -- given the above types and function this package defines the following function SEARCH(The_table:LIST; TARGET:ITEM) return INDEX; --------------------------------------------------------------- function SEARCH(The_table:LIST; TARGET:ITEM) return INDEX is NOT_FOUND:exception; --when search fails to find item type SUBLIST is array(INDEX range <>) of ITEM; --Binary search works by extracting sublists function SUB_SEARCH(The_subtable:SUBLIST) return INDEX is begin if the_subtable'length<=1 then if the_subtable(the_subtable'first)= Target then return The_subtable'first; else raise not_FOUND; end if; else declare MID:INDEX:=(the_subtable'First+The_subTable'LAST)/2; begin if the_subtable(mid)