Wolfram ResearchProductsPurchasingServices & ResourcesAbout UsOur Sites
Combinatorica Package >

BinarySearch

BinarySearch[l, k]
searches sorted list l for key k and gives the position of l containing k, if k is present in l. Otherwise, if k is absent in l, the function returns (p+1/2) where k falls between the elements of l in positions p and p+1.
BinarySearch[l, k, f]
gives the position of k in the list obtained from l by applying f to each element in l.
© 2008 Wolfram Research, Inc. japanese.gif
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team