  For two integers $r\geq 2$ and $h\geq 0$, the \emph{$h$-extra $r$-component
connectivity} $\kappa^h_r(G)$ of a graph $G$ is defined to be the minimum size
of a subset of vertices whose removal disconnects $G$, and there are at least
$r$ connected components in $G\!-\!S$ and each component has at least $h+1$
vertices. Denote by $\mathcal{G}_{n,\delta}^{\kappa_r^h}$ the set of graphs
with $h$-extra $r$-component connectivity $\kappa^h_r(G)$ and minimum degree
$\delta$. The following problem concerning spectral radius was proposed by
Brualdi and Solheid [On the spectral radius of complementary acyclic matrices
of zeros and one, SIAM J. Algebra Discrete Methods 7 (1986) 265-272]: Given a
set of graphs $\mathscr{S}$, find an upper bound for the spectral radius of
graphs in $\mathscr{S}$ and characterize the graphs in which the maximal
spectral radius is attained. We study this question for
$\mathscr{S}=\mathcal{G}_{n,\delta}^{\kappa_r^h}$ where $r\geq 2$ and $h\geq
0$. Fan, Gu and Lin [$l$-connectivity, $l$-edge-connectivity and spectral
radius of graphs, \emph{arXiv}:2309.05247] give the answer to $r\geq 2$ and
$h=0$. In this paper, we solve this problem completely for $r\geq 2$ and
$h\geq1$. Moreover, we also investigate analogous problems for the edge
version. Our results can break the restriction of the extremum structure of the
conditional connectivity. This implies some previous results in connectivity
and edge-connectivity.
