|
binaryInsert
|
The binaryInsert Function destructively inserts the specified new value
into the Structure at the proper location to preserve ascending sort order.
The Structure is increased in size to accommodate the new value.
If a matching value is already in the Structure, no insertion is made. Since there is always a matching object, either before or after insertion,
the binaryInsert function always returns the index of the newly inserted
value or the location of the matched object.
Normally a structure is not maintained in sort order, but can be sorted by invoking the sort function. If a structure has been sorted, the binaryInsert function should be used to add new keys to the structure and preserve the sort order.
(binaryInsert struct newkey) The index where the new key was installed.
Here are a number of links to Lambda coding examples which contain this instruction in various use cases.
Example_Structure_binaryInsert_001
Here are the links to the data types of the function arguments. Here are also a number of links to functions having arguments with any of these data types.
You can always talk with the AIS at aiserver.sourceforge.net.
Name
Description
AIS Types struct A predefined Structure variable or constant. Structure newkey The new key to be installed in the Structure. Symbol
Returns:
Examples
Argument Types
Character
String
Symbol
Vector
BitVector
Brick
ByteVector
IntVector
ShortVector
FltVector
ObjVector
Structure
Dictionary
Directory
CpxVector
Matrix
NumMatrix
Integer
Float
Number
Complex
Boolean
How do I contact the AIS team?