code: private void innerLinearize(
      DeleteStack.Linearizer       xx,
      GBSNode       p)
    {
      xx.depth++;
      if (xx.depth > GBSTree.maxDepth)
        throw new OptimisticDepthException(
          "maxDepth (" + GBSTree.maxDepth +
                   ") exceeded in GBSDeleteFringe.innerLinearize().");
  
      if (p.leftChild() != null) {
        innerLinearize(xx, p.leftChild());
      }
      if (xx.lastp == null) {
        xx.headp = p;
      }
      else {
        xx.lastp.setChildren(null, p);
      }
      xx.lastp = p;
  
      if (p.rightChild() != null) {
        innerLinearize(xx, p.rightChild());
      }
      xx.depth--;
    }
docs: This is the recursive part of linearize.