Description
Insert before when incomingKey is smaller, or when keys are equal and equalPolicy is before.
Ordering and stability are different properties. A stable operation preserves original order among equal keys, while an insertion policy determines which side of an existing equal key receives a new item.
Insert before when incomingKey is smaller, or when keys are equal and equalPolicy is before.
When to use this tool
Use List: List Insertion Side Tie Policy when you need one explicit key comparison or stability condition.
How to use the tool and how it works
- Enter existingKey, incomingKey, equalPolicy. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read result. Expand result to inspect the returned fields.
Insert before when incomingKey is smaller, or when keys are equal and equalPolicy is before. Report equal independently.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| existingKey | Existing Key | Required. Finite number. |
| incomingKey | Incoming Key | Required. Finite number. |
| equalPolicy | Equal Policy | Required. Text; one of "before", "after". Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| result | Result | Required. Object. |
| result.insertBefore | Insert Before | Calculated result member: boolean. |
| result.equal | Equal | Calculated result member: boolean. |
{
"input": {
"existingKey": 2,
"incomingKey": 2,
"equalPolicy": "after"
},
"output": {
"result": {
"insertBefore": false,
"equal": true
}
}
} Limitations and assumptions
- This compares one pair only; it does not locate an insertion point or sort a list.
- Outputs are nested inside result. Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Check the complete comparator and ordering rule when sorting or inserting an actual collection.
References
Similar or alternative tools
- List: List Equal Key Stability Pair
equalKeys compares the keys; stableIfInThisOrder is true for unequal keys or increasing original indices.
- List Run Length One Boundary Update
Compare leftValue and rightValue exactly.