  The spectral radius and rank of a graph are defined to be the spectral radius
and rank of its adjacency matrix, respectively. It is an important problem in
spectral extremal graph theory to determine the extremal graph that has the
maximum or minimum spectral radius over certain families of graphs. Monsalve
and Rada [Extremal spectral radius of graphs with rank 4, Linear Algebra Appl.
609 (2021) 1-11] obtained the extremal graphs with maximum and minimum spectral
radii among all graphs with order n and rank 4. In this paper, we first
determine the extremal graph which attains the maximum spectral radius among
all graphs with any given order n and rank r, and further determine the
extremal graph which attains the minimum spectral radius among all graphs with
order n and rank 5.
