Skip to content

Main content

Tree Pruned Leaf Height Bound Tool

Height bounds after simultaneously removing a subset of original leaves, in edge-height units with empty/singleton height zero.

Loading tool…

Description

Return max(0, height-1) as lowerBound and either that same value when allDeepestLeavesRemoved or originalHeight as upperBound.

A rooted tree organizes vertices by parent, children, and distance from a root. Root status changes local degree relationships, and height or leaf formulas assume the supplied structure really satisfies the tree model.

Return max(0, height-1) as lowerBound and either that same value when allDeepestLeavesRemoved or originalHeight as upperBound.

When to use this tool

Use Tree Pruned Leaf Height Bound when you need a local rooted-tree count or bound from supplied structural facts.

How to use the tool and how it works

  1. Enter originalHeight, allDeepestLeavesRemoved. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read lowerBound, upperBound. Use the output convention below.

Require nonnegative integer originalHeight. Return max(0, height-1) as lowerBound and either that same value when allDeepestLeavesRemoved or originalHeight as upperBound.1

Input fieldMeaning and unitsAccepted input
originalHeightOriginal HeightRequired. Safe integer; minimum 0.
allDeepestLeavesRemovedAll Deepest Leaves RemovedRequired. Boolean.
Output fieldInterpretationReturned shape
lowerBoundLower BoundRequired. Safe integer.
upperBoundUpper BoundRequired. Safe integer.
json
{
  "input": {
    "originalHeight": 4,
    "allDeepestLeavesRemoved": true
  },
  "output": {
    "lowerBound": 3,
    "upperBound": 3
  }
}

Limitations and assumptions

  • These are caller-model bounds in edge-depth units; actual tree structure, which leaves were removed, and whether any pruning occurred are not verified.
  • 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

Traverse a verified tree to derive parent, depth, and leaf data directly. A formula using claimed degrees or depths cannot independently establish connectedness, acyclicity, or a valid root.

References

  1. Calculation and input contract: graph/tree-pruned-leaf-height-bound — tool.io

Similar or alternative tools