Baum\Node::insideSubtree PHP Method

insideSubtree() public method

Checks wether the given node is a descendant of itself. Basically, whether its in the subtree defined by the left and right indices.
public insideSubtree ( $node ) : boolean
return boolean
    public function insideSubtree($node)
    {
        return $this->getLeft() >= $node->getLeft() && $this->getLeft() <= $node->getRight() && $this->getRight() >= $node->getLeft() && $this->getRight() <= $node->getRight();
    }