public Value get(Key key) {
        Node temp = root;
        while (temp != null) {
            int cmp = key.compareTo(temp.key);
            if (cmp < 0)
                temp = temp.left;
            else if (cmp > 0)
                temp = temp.right;
            else
                return temp.value;
        }
        return null;
    }