The function Compute the 'height' of a tree.
Height is the number of nodes along the longest path
from the root node down to the farthest leaf node.

@param  {Node} node
@return {Number}
19969
function height(node) {
  return node ? (1 + Math.max(height(node.left), height(node.right))) : 0;
}
1043510
function( node ) {
			var out = '',
				j = 0;

			if(node.tagName && this.excludeTags.indexOf( node.tagName.toLowerCase() ) > -1){
				return out;
			}

			// if node is a text node get its text
			if(node.nodeType && node.nodeType === 3){
				out += modules.domUtils.getElementText( node );
			}

			// get the text of the child nodes
			if(node.childNodes && node.childNodes.length > 0){
				for (j = 0; j < node.childNodes.length; j++) {
					var text = this.walkTreeForText( node.childNodes[j] );
					if(text !== undefined){
						out += text;
					}
				}
			}

			// if it's a block level tag add an additional space at the end
			if(node.tagName && this.blockLevelTags.indexOf( node.tagName.toLowerCase() ) !== -1){
				out += ' ';
			}

			return (out === '')? undefined : out ;
		}
877325
@Override
  protected int computeHeight() {
    N node = getRoot();
    int tHeight = 1;

    // compute height
    while(!node.isLeaf() && node.getNumEntries() != 0) {
      SpatialEntry entry = node.getEntry(0);
      node = getNode(entry);
      tHeight++;
    }
    return tHeight;
  }
1143809
public Node getRoot(Node node)
  {

    Node root = null;

    while (node != null)
    {
      root = node;
      node = getParentOfNode(node);
    }

    return root;
  }
217575
function (node) {
		  	var parent = node.parentNode,
		  		i = -1,
		  		child;
	  		while (parent && (child = parent.childNodes[++i])){
				 if (child === node){
					 return i;
				 }
			}
	  		return -1;
		}
832573
function bounds(node) {
		var clientRect = node.getBoundingClientRect();
		var scrollLeft = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft);
		var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop);
		return { 
			left: clientRect.left + scrollLeft,
			top: clientRect.top + scrollTop,
			width: clientRect.width,
			height: clientRect.height
		};
	}
1170253
function (node) {
            var len = nodeLength(node);

            if (len === 0) {
                return true;
            } else if (!isText(node) && len === 1 && node.innerHTML === blankHTML) {
                // ex) <p><br></p>, <span><br></span>
                return true;
            } else if (list.all(node.childNodes, isText) && node.innerHTML === '') {
                // ex) <p></p>, <span></span>
                return true;
            }

            return false;
        }
748616
function treeNodeCount (leafCount) {
  var count = 1
  for (var i = leafCount; i > 1; i = (i + 1) >> 1) count += i
  return count
}
968083
function(node1, node2, previousPathLength) {
    var isEverythingDefined =
      node1 != undefined &&
      node2 != undefined &&
      node1.x != undefined &&
      node1.y != undefined &&
      node2.x != undefined &&
      node2.y != undefined;
    if(!isEverythingDefined) {
      return undefined;
    }

    return (previousPathLength || 0) + Math.sqrt(
      Math.pow((node2.y - node1.y), 2) + Math.pow((node2.x - node1.x), 2)
    );
  }
443637
function heightInorder(n, x) {
  if(n <= 0) {
    return 0
  }
  var r = rootInorder(n)
  if(x > r) {
    return heightInorder(n-r-1, x-r-1)
  } else if(x === r) {
    return bits.log2(n)
  }
  return heightInorder(r, x)
}
913852
function getRect(elem) {
  if (elem && !elem.nodeType) {
    elem = elem[0];
  }

  if (!elem || 1 !== elem.nodeType) {
    return false;
  }

  var bounds = elem.getBoundingClientRect();

  return {
    height: bounds.bottom - bounds.top,
    width: bounds.right - bounds.left,
    top: bounds.top,
    left: bounds.left
  };
}
108086
function (node) {
    var x = document.documentElement.offsetLeft,
        y = document.documentElement.offsetTop;

    if (node.offsetParent || document.body) {
        do {
            x += node.offsetLeft;
            y += node.offsetTop;
        } while (node = node.offsetParent);
    }

    return {x: x, y: y};
}
439481
def get_node_size(node):
    

    free = c_longlong()

    if node < 0 or node > get_max_node():
        raise ValueError(node)

    size = libnuma.numa_node_size64(node, byref(free))

    return (free.value, size)
1156417
function parentise(tree, height) {
	if (height == tree.height) {
		return tree;
	} else {
		var list = [parentise(tree, height - 1)];
		list.height = height;
		list.sizes = [length(tree)];
		return list;
	}
}
987278
function getMindMapDimensions(root) {
    var pos = root.getPosition();
    var left = 0, top = 0, right = 0, bottom = 0;
    var padding = 50;

    function checkDimensions(node) {
      var pos = node.getPosition();
      var tm = node.textMetrics;

      if (pos.x < left) {
        left = pos.x;
      }

      if (pos.x + tm.width > right) {
        right = pos.x + tm.width;
      }

      if (pos.y < top) {
        top = pos.y;
      }

      if (pos.y + node.outerHeight() > bottom) {
        bottom = pos.y + node.outerHeight();
      }
    }

    checkDimensions(root);
    root.forEachDescendant(function(node) {
      checkDimensions(node);
    });

    // find the longest offset to either side and use twice the length for
    // canvas width
    var horizontal = Math.max(Math.abs(right), Math.abs(left));
    var vertical = Math.max(Math.abs(bottom), Math.abs(top));

    return {
      width : 2 * horizontal + padding,
      height : 2 * vertical + padding
    };
  }
1031722
function getRootNode(node) {
  if (!Node.Type.isFunction(node, 'nthRoot')) {
    throw Error('Expected nthRoot');
  }

  return node.args.length === 2 ? node.args[1] : Node.Creator.constant(2);
}
62643
function (node) {
            return this.setStart(node, node.nodeType == 3 ? node.nodeValue.length : node.childNodes.length);
        }