Efficient Spectral Collocation Algorithm for Solving Parabolic Inverse Problems