public function find($key, $comparator, $type = 0)
    {
        $cmp = -1;
        $node = $this;
        while (true) {
            $cmp = $comparator->compare($key, $node->fKey);
            if ($cmp < 0 && $node->information & 2) {
                $node = $node->left;
            } elseif ($cmp > 0 && $node->information & 1) {
                $node = $node->right;
            } else {
                break;
            }
        }

        if ($cmp < 0) {
            if ($type < 0) {
                return $node->left;
            } elseif ($type > 0) {
                return $node;
            } else {
                return null;
            }
        } elseif ($cmp > 0) {
            if ($type < 0) {
                return $node;
            } elseif ($type > 0) {
                return $node->right;
            } else {
                return null;
            }
        } else {
            if ($type < -1) {
                return $node->predecessor;
            } elseif ($type > 1) {
                return $node->successor;
            } else {
                return $node;
            }
        }
    }