arrays if searchkey is smaller than [curin]we know we should look in the lower half of the range so we move upperbound down to one cell below curin figure shows how the range is altered in these two situations lowerbound lowerbound upperbound curin upperbound curin lowerbound upperbound curin new range if searchkey< [curinfigure new range if searchkey> [curindividing the range in binary search the ordarray class in generalthe orderedarray java program is similar to higharray java (listing the main difference is that find(uses binary searchas we've seen we could have used binary search to locate the position where new item will be inserted this operation involves variation on the find(routinebut for simplicity we retain the linear search in insert(the speed penalty may not be important becauseas we've seenan average of half the items must be moved anyway when an insertion is performedso insertion will not be very fast even if we locate the item with binary search howeverfor the last ounce of speedyou could change the initial part of insert(to binary search (as is done in the ordered workshop appletsimilarlythe delete(method could call find(to figure out the location of the item to be deleted the ordarray class includes new size(methodwhich returns the number of data items currently in the array this information is helpful for the class usermain()when it calls find(if find(returns nelemswhich main(can discover with size()then the search was unsuccessful listing shows the complete listing for the orderedarray java program