Influence of assortativity and degree-preserving rewiring on the spectra of networks