Reconstruction of spectra and an algorithm based on the theorems of Darboux and Puiseux