ListTools[BinaryPlace] - perform a binary placement in a list
|
Calling Sequence
|
|
BinaryPlace(L, x, f, opt1, opt2, ...)
|
|
Parameters
|
|
L
|
-
|
list
|
x
|
-
|
anything
|
f
|
-
|
(optional) procedure, operator, or algebraic expression
|
opt1, opt2, ...
|
-
|
(optional) extra arguments to f
|
|
|
|
|
Description
|
|
•
|
The BinaryPlace(L, x) function performs a binary placement of x in L, where L is assumed to be a sorted list. It returns the value n in list L such that L[n] precedes x. It is possible that n is if x precedes all elements in the list.
|
|
In this form of the calling sequence, x must be of type numeric or string and the list should have operands of the same type in ascending order.
|
•
|
The returned value is such that is still a sorted list.
|
•
|
If three or more arguments are specified in the calling sequence, then must return true if x precedes y.
|
|
|
Examples
|
|
>
|
|
>
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
>
|
|
| (4) |
>
|
|
| (5) |
|
|
Download Help Document
Was this information helpful?