concept leaf in category algorithms
appears as: leaf, A leaf, leaf

This is an excerpt from Manning's book Algorithms and Data Structures in Action.
The heap tree is complete and left-adjusted. Complete (see figure 2.3) means that if the heap has height H, every leaf node is either at level H or H-1. All the levels are left-adjusted which means that no right sub-tree has a height greater than its left sibling. So, if a leaf is at the same height as an internal node[7], the leaf can't be on the left of that node. Invariants number 1 and 2 are the structural invariants for heaps.
When we finally get to leaves S12-S14, the execution will run the cycle at line #3, where we scan a leaf’s points searching for an exact match: if we find one, we can return current leaf as the result of search (we assume the tree doesn’t contain duplicates, of course).
Listing 10.4 Method SsNode::intersectsPoint
function SsNode:: intersectsPoint(point) #1 return distance(this.centroid, point) <= this.radius #2#1 Method intersectsPoint is defined on SsNode. It takes a point and returns true if the point is within the bounding envelope of the node.
SS-trees originally used a simple heuristic: at each step, it will select the one branch whose centroid is closest to the point that is being inserted (those rare ties that will be faced can be broken arbitrarily).
Figure 10.15 Backtracking in method insert after splitting a leaf. Continuing from figure 10.14, after we split leaf S9 into nodes S16 and S17, we backtrack to S9’s parents, S4, and add these two new leaves to it: as shown at the end of figure 10.14, S4 now has 4 children, one too many: we need to split it as well. Here we show the result of splitting S4 into two new nodes, S18 and S19, that will be added to S4‘s parent, S1. To which, in turn, we will backtrack: since it now has only 3 children (and M==3) we just recompute centroid and radius for S1‘s bounding envelope, and we can stop backtracking.
![]()